I recently received a Motorola Droid from Google for signing up for Google IO 2010. Unfortunately not the incredible, but the droid is actually a nice phone. The screen is really sharp. The physically keyboard lets you type faster. It’s a little too early to say, but I might keep this phone over my iPhone 3g. Anyhow, I thought Android will become more common in devices other than phones, why not make a quick app to learn a useful skill? Since I have previous iPhone development experiment, I’ll give a brief comparison of different areas i prefer in developing native iPhone and Android apps.
I created two native iPhone apps(voodoo doll and tweet show) with a few friends a year ago. Both are free and relatively simple. TweetShow actually hit the “Featured” page when it was named “TwitterTime.” It lets you watch tweets hands-free(ie. if you are eating).
iPhone’s built-in UI makes it really easy to make an app good looking and consistent. Android on the other hand makes it really easy to make a horrible looking app. The iPhone interface builder even lets you drag/drop elements whereas the Android doesn’t.
Android Eclipse has a strange interface builder. It’s easier to edit the XML directly but making it look nice is difficult. Editing Android UI feels like the pre-css HTML days where table tags ruled.
UI Interaction: Android
To connect a ui button to your code, it’s a multi-step process in the iPhone sdk.
In the interface builder, click and drag an outlet to its file owner.
Then in the header file, define the outlet:
@property (nonatomic, retain) IBOutlet UISearchBar* tweetSearchBar;
Then in the code file, i can use the object.
Developing interactions is easier on Android. Just name the button in the UI xml file and you can access it in the code using:
refreshButton = (ImageButton) findViewById(R.id.refreshButton);
To make an event call a method, just set the method handler in the XML UI file.
I tend to learn by examples and it was definitely an easier time to find iPhone help and code examples. For Android code samples, beware of which version the help/code examples are targeted for. Not sure how true this is, but it felt the iPhone API changes were more stable than Android over the different versions.
Wow. I cannot believe how easy it is to publish an app on Android compared to iPhone. It literally took 5 minutes to get an app signed and published on the Android. I remember the first time I published an iPhone app, it took at least 5 hours of debugging various problems in the signing and build configuration.