Titanium and Android: First Impressions

Recently I have spent a bit of time using Appcelerator’s Titanium to prototype an Android app. I thought I would put up some first impressions.

Setting Up My Environment

Installing the Android SDK takes ages. Then I had some problems with the latest (R12) release on Windows which took up a lot of my time. In the end, I decided to install it all on a Ubuntu VM, which worked fine.

Installing Titanium was easy enough, so no problems there. Setting it up with the Android SDK was as easy as browsing to the directory where I extracted it.

Developing With Titanium

Developing with Titanium is brilliant. The API’s are well documented, while the IDE has a clean interface and IntelliSense. Writing an app in JavaScript just feels natural.

Loading the Android emulator takes quite a long time, even longer if you are loading Android 3.0 (upto 15 mins). However, once its loaded you can develop and run your app again without having to restart the emulator, so its not too bad. Ideally you will want a machine with plenty of RAM, but it worked OK in a VM with just 1GB.

Conclusion

Overall I enjoyed my little foray into Android development with Titanium. I would definitely recommend it, based on my very limited experience. If only I could think of a real-world app to write, so I could truly kick its tyres…

Links

Emulator Not Working On Windows With Android SDK R12

I have spent a lot of time trying to get the Android SDK set up on Windows XP (with Titanium), but was getting the following error:

invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.

And this one:

C:\android-sdk11\tools\emulator.exe -avd titanium_7_HVGA -port 5560 -sdcard C:\Documents and Settings\ajones\.titanium\android2.sdcard -logcat '*:d *' -no-boot-anim -partition-size 128
invalid command-line parameter: and.

It is caused by this bug, where the SDK does not handle spaces in paths correctly.

Until the bug gets resolved, the most simple workaround at the moment is to use the previous version of the SDK, R11, which is still available at http://dl.google.com/android/installer_r11-windows.exe. Once installed, it will ask you which updates to download. Ensure you do not download the R12 release of the platform SDK! This should be the top item. Highlight it and choose Reject.

Update: better workarounds have been suggested in the comments.

This took many hours for me to get around – installing and uninstalling the SDK. A really poor bug for the Android team to release with, and I am not left with a good first impression of the Android SDK.

Update January 2012: pleased to say that this has been fixed in newer version’s..