Sunday, October 03, 2010

Even before Hello Android

Piqued by curiosity on the much touted freedom to develop applications on Android, I decided to take the plunge and see for myself. The recommended approach is to follow instructions

My first concern was that Quickstart recommends using the ADT (Android Development Toolkit) as an Eclipse plugin. I have used Eclipse, and know it to be _highly_ configurable. However each time I used it, it was already configured by a system engineer who is more competent than I at developing ANT scripts and what-not.

As it turned out, I didn’t have to worry overmuch ... not yet anyway. Installing Eclipse was a snap. Subsequently it was only a matter of following instructions on the Android site to install the plugin. Phew!

My first hiccough came after creating a project using the plugin wizard. The Android console kept showing a message to the effect ‘AndroidManifest.xml’ could not be found. The file itself, however, was listed in the package view. Hmmm? Took me a while to find out what happened

The problem was that the Android Wizard generated code in two parts

1. Code that is not meant to be modified (recognized by a ‘Generated Java Files’ label)
2. Code that is meant to be modified

The latter relies upon the former; however by default the packages were arranged such that the former was listed after the latter; this caused dependencies to fail.

The solution was to

1. Rearrange the packages created so that code with the ‘generated java file’ appeared before the latter, and
2. Navigate into Project Properties > Android Tools > Fix Project Properties

Now my first Hello World ( if only wizard generated ) is in place, and I'm off to try to run it having made a note of what went wrong even before running the app!

More later!!