DigitalFriend Blog

September 2009

Game On, Android - in a few countries

Wed, 9 Sep 2009 20:09:09 +1000

By: gosh'at' (Steve Goschnick)

I just couldn't help but see the ADC II (the 2nd Android Developers Challenge) as an opportunity too good to miss! The cut-off for submissions was the end of August just gone. The prize money is good indeed if you can land any part of it - Google is offering nearly $2 million dollars spread across 30 winners (a 1st, 2nd and 3rd across 10 categories). Well, it was early July when I dusted off the C++ code for my puzzle game 'OctaDial' - I originally invented and wrote it as a learning exercise in the C++ language in 1990, and that learning exercise then got so far as to become a commercial game on MS-DOS - but it was only ever marketed in Australia for about 3 years, up until late 1993. It seemed like an appropriate echo in current times, to rebirth OctaDial for the Android in Java, as a serious learning exercise in Android programming that may pay good dividends? It was never worth doing the game in Java on Windows or on Mac OSX, as Java is a second-class citizen on both those operating systems - but the Android system is based on Java itself. Java is first-class on Android - at this point in time its the only language you can use to develop there. Besides that, OctaDial has always been waiting for some small device to come along, something very much like the new generation of Android smart-phones with their good-sized screens, with touch, and a decent pixel resolution.

Image 1: OctaDial in landscape mode on a HTC Magic (from Vodaphone in .au)

I brought in son Tim as Artist, who is currently doing a Degree in Computer Games (lucky lad) and knows his way around graphics and music. Coincidently, he was born in 1990, in line with the original OctaDial on DOS! Dr Christine Sun, my better half, came onboard as Translator, giving us Traditional and Simplified Chinese locales almost right away. The following image is the main menu and the game in portrait mode, in the phone emulator within the SDK (software development kit).

Image 2: OctaDial in portrait mode on the phone emulator, and main menu options

We figured it was important to pick up as many locales as possible for those countries where they currently are or will soon be selling Android-powered phones. Since there is not a lot of language in the game - as you can see in Image1, during game-play itself there is no language at all - it was conceivable to do a handful of languages, even in the hard-pressed time schedule laid down by ADC II. However, as can be seen in Image2 above, there are the menu button labels, plus a paragraph in 'The About' pop-up window and another paragraphs worth in the player's 'Mission' pop-up (see figures below). With some editing by friends, family and associates, Christine managed to include 7 languages, namely: English, Traditional Chinese, Simplified Chinese, Korean, Japanese, German and French (plus some Italian).

Image 3: The 'About' and 'Mission' pop-up windows in Traditional Chinese

Pros: What are the main positives about Android I got from the experience? 1. Its use of SQLite for data storage and retrieval - the same reason we use SQL in DigitalFriend sub-agents, left, right and centre. 2. Finally, an operating system that takes client-side Java seriously - even Sun didn't do that, they weren't much into client-side systems and were really a hardware company. 3. The use of XML for interface resources (declarative programming), facilitating easier-than-usual inclusion of different country Locales. 4. The Android groups (beginners and developers) are a good source for programming tips - I got most from the answers to other peoples' questions, very few of my direct questions got answered. Thats was about par-for-the course, during frenetic August at least - probably about half of the questions up there didn't get an answer, but then many of the ones that did, held valuable advice. That will possibly change now that its post-competition -hopefully more people will be more generous with their knowledge. 5. The phone emulator (as seen in all these images here, except image1) works well, its nicely integrated with the Eclipse IDE, and brilliantly allows you to test all the different locales you intend to support in your application, as per these images here. I.e. Even though Android phones can cope with them all, a given actual phone, bought in a given country will probably be configured for just the one locale - so you can't test them all on the one real phone..

Image 4: The 'About' and 'Mission' pop-up windows in French

Having now used the HTC Magic phone for a few weeks, I can see why gadgets like Nintendo's DS and Sonys PSP handhelds are starting to see their sales slump badly - touch smart phones like this one, and the iPhone are all over the DS and PSPs marketplace. And the broad stream of developers being tapped (so far, most obvious in the iPhone market - which has now sold over 200 million units, but the much newer Android technology offers more flexibility and multiple phone manufacturers), is showing innovation and variety in their applcations that those older handhelds will not be able to keep up with... not to mention the low price of applications and games, with the average price under $2 - people who pirate at these prices are simply risk-takers begging for trouble.

Image 5: The 'About' and 'Mission' pop-up windows in Korean

Cons: Its no walk in the park - the learning curve for Android development is steep, even for seasoned Java developers. I did the conversion in two phases: I did a conversion from the original C++ DOS Octadial, to Swing-based Java in less than 2 weeks; but it then took me the best part of 6 weeks to go from that Swing version to the fully-functional Android version as submitted on August 31st - despite the fact that they are both in Java. To be fair to Android, I know my way around Swing in the dark, and I wrote the graphic system for DOS upon which the game C++ code sat - so that first conversion phase was always going to be a push over. But why so long to go from Java to Java?

Well, it has polish (the submitted OctaDial) but Android is really a different application paradigm from the desktop application - about half-way between the desktop and older mobile phone systems. You have one activity at a time dominating the screen and the user's attention. The phone or the user may interrupt at anytime - the phone with an incoming call, say, and the user may hit the Home button (yes, it has a home screen like a desktop) or similar and do something like check their G-Mail account or the web-browser at random, and when/if the user returns to your application (OctaDial in this case), they expect it to be where it was when they left it. Thats all well and fine, but, in addition Android may throw the whole thing out if it needs the memory, so there are various points where you can and should do various saves of state, and recalls from state. In addition to that, the user may rotate the phone from portrait to landscape mode, and a good application is expected to do a mode switch, which my require a second interface design (as is the case with OctaDial, e.g. Images 1 and 2). In addition to that, Android is not a fixed phone format like the iPhone, its an Open Alliance of manufacturers, which means variety in hardware configurations: some phones have keyboards some don't; some phones have touch screens, some don't; some phones have a track-ball or a 4-way directional pad, some don't - and your user interface needs to cater for all those possibilities.

Image 6: The 'About' and 'Mission' pop-up windows in German

I bought two books in an attempt to ease the move-to-Android process ('Hello, Android' by Ed Burnette, The Pragmatic Programmers; and 'Android Application Development' by Rick Rogers et al, O'Reilly). The first is a great 'jump-start' sort of book particularly if you are doing a game, and brief. However, its a bit hypertext-ish with some broken links (i.e. far from a sequential read), and it walks a narrow path in places, and as soon as you step off it - bang. The second one was better on SQLite3 usage, but the rest was pretty pedesrian (well, to be fair I only read about half of it).

Image 7: The 'About' and 'Mission' pop-up windows in Simplified Chinese

I can now clearly see why Google had this ADC competition this year and last: to jump-start some substantial number of experienced developers - its a significant technical hurdle, and so developers do need some considerable incentive to get started down such a new path. I can also see why they reach out to University students in their push for Android developers - they are the ones taught Java in some depth, and who are relatively platform-neutral as they emerge from their degrees.

Image 8: The 'About' and 'Mission' pop-up windows in English

Would I personlly write another program for Android? Its a clear YES, that 6-weeks was a big (but fun packed) learning exercise and it would be a waste of time-spent not to use it now. On the other hand, we can't sell these things from Australia as yet? While we can access the Android Market and download freebies, we can't put up paid applications or buy them (often, they are the better ones - but not always). I had thought the long-negotiated free trade agreement between US and Australia was going to streamline these sorts of issues for us here, but so far, apparently not. So, we have a game here that only costs a very reasonable $1.33 but we can't put it up on the market as yet, because we are unable to technically do so. Which Country's developers/publishers can do so? Those from the US, the UK, Austria, Germany, France, Spain and the Netherlands. With respect to the rest of us, perhaps this is just teething problems within Google, or perhaps its just their priorities, or perhaps its something to do with respective tax departments/regimes across countries? Its hard to get any information about such things? i.e. Theres no google group/s that have this sort of info, cf the technical data where information does flow freely. Still, its a far better start by Google (7 countries to date) than say, Amazon with eBooks on their Kindle device - which has been out for years now, but you still have to be pretty much a US citizen (i.e. US bank account and ID) to publish anything for it. I.e. Where a company such as Amazon is just interested in selling to the world, it seems that Google has a genuine global commitment to software developers, publishers and consumers who purchase quality - e.g. the ADC II challenge itself is open to developers from just about all countries bar those with a general trade-embargo - its just that its merchant rollout has only reached as far as the US and the EU thus far, for reasons which probably vary from country to country.

Image 9: The 'physical' menu pops-up across-app options, in Japanese here

However, for non-developers of Android applications, i.e. for users of Android powered phones (such as the HTC Hero, the HTC Magic, the Samsung I7500, the Motorola Clic, etc), things are great: you can become a 'community judge' within the judging process of the current ADC II competition, allowing you to freely download and use some number of competition applications, for the cost of your 'opinion'. I.e. If you want to get your hands on OctaDial, at the moment thats the only way you can get to it.

You may have to change Telcos to get such a phone - I had to leave Telstra for Vodaphone in order to get my hands on a HTC Magic, and, If Telstra don't get themselves an Android phone in their line-up this side of Christmas, they are going to loose a lot more long-time customers than just me.



Home | Site Map | Privacy Policy | Contact Us | ©2008 Solid Software Pty Ltd