Thursday, July 1, 2010

Creating a New Android Project using Eclipse - ADT plugin

Summary:
Creating an ANDROID project basically involves
1. Creating an virtual device for emulating a physical mobile device
2. Creating a New Project

Important points:
Android programs are Java programs- so Java package naming conventions apply.
User-interface components can be created programmatically and declaratively.
However, best-practices suggest separating the view presentation layer from the logic layer.
The main entry point: A class which extends the Activity super class (simplest case) containing a function called onCreate( Bundle bunde)
Data-binding occurs via an automatically generated R.java file for accessing variables from *.xml based files.

1. Create an AVD - Android Virtual Device by clicking on the Android-ICON


Specify details of the new AVD


2. Create a New Android Project


Specify the following details...and then Click FINISH
Project Name: TestAndroid
Build Target: Android 2.2
Application Name: TestAndroid
Package Name: com.android.example
Create Activity: Eg1



3. Project and main Activity is created!

Installing Google's Android Eclipse ADT Plugin

Download and Unpack the Android-SDK:
http://developer.android.com/sdk/index.html

Installing the Eclipse - ADT plugin:
1. Open Eclipse
2. Go to HELP -> Install New Software




3. Click ADD to add the Google-ADT update site
4. Enter name: Google ADT
Enter site: https://dl-ssl.google.com/android/eclipse/



5. Click NEXT
6. Agree to Licence Agreement
7. Download and installation proceeds....
8. When prompted to Re-start click Yes.

9. NOTICE: Click on Window -> a new menu item
Android SDK and AVD Manager
10. Click Preferences ..Android Menu
11. Specify location of downloaded Android-SDK