Thursday, December 15, 2011

Preparing an android development environment

In this post i will share information in how to prepare your android development environment for easily making android applications.

Note: The information included in this post is general and you can find it anywhere, but i collected it in an (all-in-one) post so that newbies and !(Java-Awared) developers find it easy to work within an android environment.

Table of contents
  • Softwares needed
  • Installation steps
  • Android virtual device
  • Conclusion
  • References (Very important)
Softwares requirements
  1. Java development kit (JDK) (Download it from here)
  2. Eclipse IDE (Download it from here)
  3. Android SDK starter package (Download it from here)
  4. Android ADT plug-in for eclipse
Installation steps
  1. Install Java development kit [What is JDK?]
  2. Install eclipse Integrated development environment [Its more than just an editor :-)]
  3. Install android Software development kit starter package [It includes the core SDK tools, which you can use to download the rest of the SDK components (such as the latest Android platform)
  4. Installing the Android development tool (ADT) plugin for eclipse:
    • Start Eclipse, then select Help > Install New Software....
    • Click Add, in the top-right corner.
    • In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: [https://dl-ssl.google.com/android/eclipse/]
    • Click OK.
    • In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
    • In the next window, you'll see a list of the tools to be downloaded. Click Next
    • Read and accept the license agreements, then click Finish
    • When the installation completes, restart Eclipse.    
  5. Configure the ADT plugin:
    • Select Window > Preferences... to open the Preferences panel (Mac OS X: Eclipse > Preferences).
    • Select Android from the left panel.
    • For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
    • Click Apply, then OK.
Android virtual device
An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual  device by defining hardware and software options to be emulated by the Android Emulator.
  • Creating an AVD
    • From Eclipse by clicking Window > Android SDK and AVD Manager. You can also start the AVD Manager from the command line by calling the android tool in the tools directory of the Android SDK.
    • An AVD consists of

      • A hardware profile: Defines the hardware features of the virtual device. For example, you can define whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how much memory it has, and so on.
      • A mapping to a system image: You can define what version of the Android platform will run on the virtual device.
      • Other options: You can specify the emulator skin you want to use with the AVD, which lets you control the screen dimensions, appearance, and so on. You can also specify the emulated SD card to use with the AVD.
      • A dedicated storage area on your development machine: the device's user data (installed applications, settings, and so on) and emulated SD card are stored in this area.
      • You can create as many AVDs as you need, based on the types of device you want to model. To thoroughly test your application, you should create an AVD for each general device configuration (for example, different screen sizes and platform versions) with which your application is compatible and test your application on each one.
    • Keep in mind
      • The API Level of the target is important, because your application will not be able to run on a system image whose API Level is less than that required by your application.
      • You should create at least one AVD that uses a target whose API Level is greater than that required by your application, because it allows you to test the forward-compatibility of your application.
Conclusion

In this post i didn't mention everything about android installation as i didn't mention anything about troubleshooting so i'd recommend the reader to check the references section if anything went wrong.

References
  • http://developer.android.com/sdk/installing.html
  • http://developer.android.com/guide/developing/devices/index.html
  • http://developer.android.com/guide/developing/devices/managing-avds.html
  • http://developer.android.com/resources/tutorials/hello-world.html

2 comments: