Showing posts with label iPhone. Show all posts
Showing posts with label iPhone. Show all posts

2010-10-10

Built my first AIR app for iPhone

Well this past week I got my first ever smartphone, namely an Apple iPhone 4. It wasn't my first choice, I would have preferred a phone running Android, but my carrier had no such phones available...until this week of course (got to love how that works eh?).

Needless to say, after getting familiar with this iPhone, I wanted to see if I could build an app for it and after some research I found out there are several ways to do this:
  1. use XCode
  2. use HTML/JS/CSS
  3. use AS3/Flash
The first method described above is what is used in 98% of cases. You need a Mac and must have downloaded the XCode development environment and you can build an iPhone app (actually any iOS app...so it can run on iPhone/iPad/iPod) in the Objective C language.

Using the second method, you build a web application using traditional HTML/JS/CSS technologies and then compile them into a native iPhone app. There is a tool called Titanium Developer that I found that allows you to do this.

The third and final way to build an iPhone app is to use the Adobe Packager for iPhone. This little piece of technology if you remember caused a big stir back in April 2010 - cause Apple end-up changing its developer agreement and basically did not allow any third party tools, such as this one to compile any code for the iOS. Well I guess people complained and on Sept 9th, 2010, Apple changed their agreement once again, this time allowing such tools to be used. So basically I download it and build a very simple temperature conversion app (Fahrenheit to Celsius).

The Adobe Packager for iPhone allows you to take a SWF file an converted it to a native iPhone application. You can create your SWF file either by using the Flash CS5 authoring tool or by creating an AS3 project using the AIR 2.0.1 SDK in Flash Builder. In my case I built an AS3 project using Flash Builder and once the SWF was generated, I then used the iPhone packager to generate an IPA file. Then this IPA file is imported into iTunes so you can install (sync) the app onto the iPhone itself.

So its pretty cool to create your first iPhone app using AS3 and see it running. But there is a caveat. As I mentioned before, within Flash Builder you have to create an AS3 project to build the app. You can't create a regular Flex project that uses mx:Application or mx:WindowedApplication as its root class. You have to create a simple HelloWorld.as class that extends Sprite. So you can't use any of the regular controls such as mx:Label or mx:Button. Within an AS3 project you can only use the flash.text.TextField class and use that as a label, textbox and as a button where needed. So building an app in this way can be very time consuming to say the least.

Assuming that Apple doesn't change its stance once again, I'm pretty sure Adobe will be improve how we can build AIR apps for the iPhone in the very near future.

Important Note: In order to develop an app for the iPhone you first much purchase an iPhone Developer Certificate and this costs $99/year. Or you can jailbreak your iPhone :)

2010-08-30

Ottawa Mobile Dev day recap

On Saturday I went to the Mobile Dev Day in Ottawa and here is a brief recap of what I saw.

Windows Phone 7
It was the last prez of the day and for me it was by far the most interesting, so you could say they saved the best for last. The presenter actually demoed a beta version of the phone (due out in Nov of this year) with all of its features and then proceeded to use Visual Studio to create a couple of simple apps and run them in the simulator to demonstrate a simple development cycle. A couple of the sample apps he built used the Azure services (provinded by MS for a monthly fee of $12 - dont quote me on that) to push information to the phone. The development was done in C# so easy for existing Windows developers to pick up on (or even Java developers like me!).

Adobe AIR on Android
Unfortunately there was no demo, just a look at sample code and what extra APIs are provided to AIR for the Android OS. Again this is just a beta, so you can try it out yourself by downloading the add-on here. Although you can access things like the Geolocation API and the Accelerometer, you cannot unfortunately access the phone's contacts or any over local data. Maybe in the next version.

iPhone
Two words: Objective C. We had two presenters for the iPhone and although the apps looked great (like they always do), I can't say that programming in Objective C turns me on. It looks so archaic. Dealing with pointers? Remembering to free up memory? That's so 15 years ago! There is a glimmer of hope however, you can use PhoneGap to create HTML/JS/CSS apps and deploy them to the iPhone. But you have to have a Mac in either case to do iPhone development. Bah!

2010-07-31

Adobe Ottawa Mobile Developer day

Adobe is holding a developer day on Saturday August 28th, 2010. They will showcase development for mobile devices using Adobe tools for various platforms, including iPhone and Windows Phone. The mini-conference is free, so better sign up as soon as possible here.