The Packager for iPhone is a feature of Adobe Flash Professional CS5, which offers Flash Developers to use Action Script 3.0 to deliver iOS applications for devices like iPhone, iPad, iPod etc. Flash CS5 has the ability to publish Flash application iOS. As a part of our course, prof. Dan Zen introduced us to this technology and with his help I developed some games for iOS using Flash. This was really a mind blowing experience.
Few words about becoming an iPhone Developer:
Before you start developing applications for iPhone you will need to register in the Apple iPhone Developer program (http://developer.apple.com). There are three different programs you can enrol in. There is free version in which you can download the iPhone SDK and develop apps in your desktop. It won’t allow you to upload the app to an iOS device. The standard program, costs $99/year, allows you to develop applications and distribute in the App store. The enterprise program, costs $299/year, is meant for companies which develop and distribute in-house application. Luckily as I am a student of Sheridan, I was able to enrol for standard program without paying $99.
iOS Dev Center:
This is the online for your iPhone Development Account. You can download sample codes, user guides etc. from here. Once you login to the iOS Developer Account, it will take you through the necessary steps to get your application on to your device. This portal allows you to create developer certificate and provisioning profile. It also allows you to install your application on to the device.
With the ability to publish iOS application, Flash CS5 comes with many features which can be of great use for developing iOS applications.
- Accelerometer: Flash.sensors.Accelerometer class gives us the ability to interact with accelerometer in iOS. iOS uses accelerometer to detect rotation, gravity, translation, shake etc.
- GeoLocation: Flash.sensors.Geolocation class enables us to interact with devices location sensor.
- TouchEvent: Flash.events.TouchEvent class is use to detect when user touches the screen
- GestureTransformEvent: The GestureTransformEvent class can detect four different types of gestures: swipe, rotate, pinch and zoom, and pan.
My Experiments in Publishing iOS app from Flash:
First I created an Apple development Account. After signing in to the Apple iOS Dev Center, I generated a Certificate Signing Request to obtain Developer Certificate. Then I installed OpenSSL and convert the certificate to a P12 file.
In the provisioning portal I added the device using its UDID (obtained using iTunes) and created an app ID. After this I created a provisioning profile using the app ID and the developer certificate. Provisioning profile allows you to test specified app on a specified device using your specified developer certificate. To test more than one app you need to create more provisioning profile.
In Flash I created a new file using iPhone OS. I created a small Pacman game using accelerometer class. In iPhone OS Settings, under General tab I added included files like .mp3 files and .swf file. Under Deployment tab I added my development certificate and the Provisioning profile. Under Icons tab I added the .png image as icon for my app. Once I hit publish, an .ipa file is created. I dropped this file under the apps tab in iTunes and synch it with my iPod. I was really excited to see my first game on iOS.
Here is the video link for my Pacman game demo :
Instruction on creating iOS Dev Account, Developer Certificate and Provisioning Profile: http://help.adobe.com/en_US/as3/iphone/index.html
- Book which explains about iOS application development using Flash CS5 : http://ca.wiley.com/WileyCDA/WileyTitle/productCd-0470622040,descCd-description.html
- Instructional video on Flash CS5 Creating iPhone apps and publish settings : http://www.youtube.com/watch?v=jNzJhSnN51Q&feature=fvw
- Adobe lab: http://labs.adobe.com/technologies/packagerforiphone/
- Best coding practices for developing Apps for iOS devices : http://www.quora.com/What-are-the-best-practices-for-developing-apps-on-multiple-platforms-iOS-Android-BlackBerry
- iPhone packager optimisation techniques by Justin Howlett : http://justinhowlett.com/fphandout.pdf