One of the projects I'm working on has an important mobile component. I'm myself an Apple fanboy and iOS development would be the most obvious choice, but by most important alpha testers are from the Google camp and since I do value potential paying customers I decided to dive into Android development.
Years ago I've done my share of coding and development work, but over the years this has become a bit rusty but of course I still understand the basic concepts. I'm not going to write a getting started tutorial because the Android developers community and Google give you a good start. I will focus on other experiences and surprises on the go.
The application is fairly simple, it consists of a few screens where the user can enter some information that needs to be stored locally for offline use of the application. When the user chooses to do so the information can be synchronized with a OAuth authenticated JSON service. In my opinion a very typical kind of mobile application offering a mobile specialized experience for an existing service. The users already has an account at the service that exposes an API offering JSON REST services with the de-facto standards OAuth authentication. There are probably millions of people building similar applications every day and I didn't expect a lot of hassles. So lets look at what was easy and what went fast and where I spend most time.
What was easy and progressed quickly
- Getting a development environment up and running went a lot easier than I expected. I'm working on a Mac and already had an Eclipse environment up and running. Just follow the instructions and 30min later I was in business.
- Understanding the basic concepts of Android development and application architecture. I like the Activity concept and the possibility for late run time binding between applications. This combined with the XML layouts and some 'code behind' quickly got me up and running with the basic user interface
- Creating a local data store based on SQLite and actually writing and reading data.
I just got up and running pretty quickly and felt confident that I would be ready quickly, but then reality hit. Where did I loose time?
- I was really surprised that an OAuth consumer was not part of the framework. I was probably too naive to think that all applications would use OAuth for their authentication mechanism. An external library (signpost) was found quickly and at first it looked also easy to implement but due to my own mistakes somewhere lost valuable time to get it really working.
- I was easy to display information form the data store unmodified in a ListView, but when I tried to combine and modify information from the data store before displaying I quickly got sucked into creating my own CursorAdaptor. It all worked out, but just was more work than anticipated.
- I never liked dates, timezones, localized and user specific date formats. This showed in many areas. It started with a the fact that SQLite doesn't have a date/time data type. It took some experimenting and finally I learned to store dates as Integers and got all the conversions between UTC time and local time working. The web services was also dealt easy enough with all dates in UTC time and thus local calculations were required. However having the correct date and time is not enough, users want them displayed in their personal format. I spend a significant amount of time on this, thought I had it working on the emulator, but got users complaining it's not. This probably is my biggest nightmare at this point. I really don't understand why the platform doesn't have a format to local preferences date/time format function.
- The XML layout are a nice concept, but when doing a bit more complex screens impossible to understand. The eclipse visual editor is worthless and the XML attribute names are so confusing and big that it's not really easy to create a nice layout. I still don't manage to get nice automatically scaling layouts going. This is a pity because it's the first impression of the application.
Concluding I would say that I enjoyed building for Android, the basic concepts are easy to understand and I like the overall architecture of the framework. However Android and the development framework is still a bit rough on the edges, tasks that I expected to be simple are just not facilitated by the framework or are so complex that they are hard to understand.
Now going for the next mobile platform to get better comparison. What do you suggest I should work on now, iOS, Symbian, WebOS, BlackBerry or Windows Phone 7