This is a mirror of official site: http://jasper-net.blogspot.com/

Getting Started with Android – Creating Android Application

| Wednesday, February 16, 2011
This is ongoing blog on Getting Started with Android. In earlier blog, I provided an architecture overview of android application. In this blog, I will setup the development environment for Android and create a simple hello world application.

I would say are two ways you could develop Android applications-

The web development way: – Utilizing your web development skills like- HTML, CSS 3 and JavaScript (JQuery libraries). For instance, software’s like PhoneGap let you create web applications and uses a native bridge to run your applications to most leading mobiles- Android, IPhone and Blackberry.
Android SDK : – Using the Android SDK and third party android Java libraries to create applications using IDE like Eclipse.
I would start development with the later approach, but I plan to include web development also as part of this android series.

Here are the software’s you would need to create Android applications –

Eclipse IDE – I plan to use Eclipse IDE. You would need to install the Eclipse SDK “classic” platform. I have used the latest version 3.6. Download it from here.

Android SDK Starter Package – Download the android starter package windows installer from -http://dl.google.com/android/android-sdk_r08-windows.zip . The Starter package lets you choice and installs Android SDK components. Run the Android SDK Starter Package installer. The Android SDK Starter Package requires Java 5 or 6 and it would detect during installation. Once you install Android SDK Starter Package, run the SDK Manager.exe from installed location. On the Choose packages to install, click Cancel as we would install required packages only. Note that the applications developed on new versions of android are not backward compatible, for instance applications developed on 2.3 would not work on 2.2, but applications developed on 2.2 should continue to work on 2.3. (how ever this may no be the case always, so its best to test out the application on emulator).

Click on Available Packages and select SDK platform 2.3 (latest version) and Samples for SDK API 9 as shown   below. This would installed Android SDK and its dependent components.

Android ADT – Android development toolkit is an eclipse plug-in, which provides an integrated environment in eclipse for building and testing android applications. You can use the update manager in eclipse and install the ADT automatically or download the ADT Plugin zip from – http://dl.google.com/android/ADT-8.0.1.zip and install it manually. I prefer to use download the plug-in and install it manually. Once downloaded, follow these instructions:

  • Start eclipse . Click on Help -> Install New Software
  • Click on Add. In the Add Repository, Click Archive and provide the location of downloaded ADT zip file. Enter Name as ADT local. Click Ok
  • Click on Developer Tools and Click Next
  • Click Next. Accept the licenses and Click Finish.
  • This would install ADT plug-in. Restart eclipse
  • Next specify the location of Android
  • Click on Windows -> preferences

Next, Click on Android. In the Android preferences, click SDK location, click Browse and provide the location Android SDK location. Click Apply.

To check our installation was fine, we will create a hello world application and run it via Android emulator. Before running the Android application, you need to create an Android Virtual Device (AVD). AVD as the name suggest is a virtual device that emulates an android device and runs the application. The eclipse plug-in internally used android avd command, to create the AVD.

Click on Window > Android SDK and AVD Manager.  On the Virtual devices editor,Click New
Specify the Target as Android 2.3- API Level 9. (or the android environment which you want to create applications) , specify size of  SD card and skin for the emulator as shown below. Click Create AVD.


Read more: Javalobby

Posted via email from Jasper-net

0 comments: