Creating Android App: Goodbye World!

Posted on May 5, 2010

I’m not going to get into the details of writing our first Hello World app.  You can do this on your own if you want.  I cheated, I’ve done it before.  There are some important things to know how to do though.  I’ve forgotten, so its good that I’m going over them again.

First you should set it up in Eclipse.  Here are the instructions from the Android developer’s site…
  • Start a new app

    • Open Eclipse
    • Go to New in the menu, then select Project.
    • Drop down the arrow to the left of  ”Android”
    • Select “Android Project”
    • Give your project a name (mine is “Blowing Up”)
    • Below, we need to select a Build Target, or version of Android we want to make this for.  This will make a difference since building for newer Android versions may render your application useless on older devices (and maybe the other way around as well, I don’t know yet.)  Since I have a T-Mobile mytouch, I’m going to go with the 1.6 build.
    • Give your application a name.  This might be different than the project name. It reflects the actual name of your app.  I’m naming it “Blowing Up” as well.
    • Give your package a name (you said package).  Basically, its the path to your classes.  Often they’re like, “com.adobe” or something, so I’m going with “com.phillips”, then as I create more classes for other projects, I think it’ll keep it all nice and tidy under my name (maybe I’ll get famous!)
    • I’m not 100% what the heck the Activity is.  Probably some Java identifier thing.  However, using the same naming convention that the Hello World tutorial used, I’m labeling my Activity “BlowingUp”.
    • Click Finish

Right away I had 2 errors regarding not locating my gen directory or something.  I just went to “Project” and then “Clean” and now its all good.   I’ll get into the code and such later, for now I want to make sure my environments are all set up and working correctly. So, next…

  • Test it in the Android Emulator (or Android Virtual Device (AVD) as they call it)

    1. In Eclipse, choose Window > Android SDK and AVD Manager.
    2. Select Virtual Devices in the left panel.
    3. Click New.
      The Create New AVD dialog appears.
    4. Type the name of the AVD, such as “my_avd”.
    5. Choose a target. The target is the platform (that is, the version of the Android SDK, such as 2.1) you want to run on the emulator.
      You can ignore the rest of the fields for now.
    6. Click Create AVD.
    7. Close out any extra windows.
    8. Click on the green arrow button up top and ideally, after a minute or two, the Android emulator will appear.  Possible even once the emulator appears that it’ll take forever for Android to start up on it.

Finally, need to test it on the Android device itself, but I don’t have my cable on me, so I’m saving that for later.  I though it interesting to note that despite not having done anything, my brand new unmodified app had “Hello World, BlowingUp!” in it already.

Alright, everything is working, now to start programming!

Share and Enjoy:
  • Digg
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Print this article!

Categories: Android, Development


Leave a Reply