Friday 26 August 2011

My First Android App

To carry on my 'new technology' learning, I set-up my machine for Android development. To my surprise this again was very easy! I already had Eclipse and the JDK installed, so it was just a case of getting the Android SDK and the Eclipse Plugin.

With both of those installed I was ready to start my first Android project. This was literally just a case of clicking File -> New -> Project -> Android Project. The project starts you off with all the boiler plate you need to get going, with the main part being a core "Activity". Activities are the Java classes which contain the main bulk of your application, each Activity can be thought of as a different page in your app.

So great, I got a very basic project created, but now I want to run it! This is just a case of right clicking the project and going Run As -> Android Application. At which point it fired up the Android SDK Manager and alerted me I need to create a new Android Emulator. This is where I hit my first problem! After creating a new Android 2.2 emulator, it wouldn't start, giving the following error:


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


I checked and double check my install, at which point I decided to Google the problem and found the following link:

http://stackoverflow.com/questions/6638713/android-emulator-is-not-starting-showing-invalid-command-line-parameter

So great, a nice simple answer, just change your Android SDK path in Eclipse so that the space is encoded and it works! My android emulator was up and running. Then my next problem...When I fire up my app, all I got was a screen saying "Android..."


Weird huh? I didn't think this what my app should do! Turns out it's not weird, this is just the loading screen!! doh!! At which point I feel like an idiot, but turns out I'm not the only person that got stumped by this =)

Anyway after loading, my android app was up and running, nicely showing "Hello Ash" - cool but not very functional. As Louise said "at least it's friendly".

Next step, actual functionality!

No comments:

Post a Comment