Wednesday, 29 August 2012

Android setup steps and Running first application


For android you need following files,
1. ADT-12.0.0.zip
2. Androidsdk.zip
3. Eclipse.zip
Extract androidsdk and eclipse.
Now open eclipse,


now you need to install ATD, so in eclipse go to “help” tab, select “Install New Software” option,


 Now click on “Add..” option,






Click on “Archive” option, and select “ADT-12.0.0.izp” file from the directory where you have saved it.



Click on “Open”, Select all the options,



Click on “Next >”,


Click on “Next >”,



Select “I accept the terms of the license agreements”, click “Finish”,


Click on “Apply Changes Now”





Now we need to configure the android sdk, so go to “window” tab and select option “Preferences”





Select “Android” option which is at the top left corner,




Click on “Browse..” option, and select “androidsdk” folder,the one which you have extracted,



Now we are going to create emulator, on which we are going to run our android applications,


Select that “AVD manager” tab,





Click on “New..” to create new emulator,
Now specify the details as follows,

And click “Create AVD” option,


Select “Test’, and click on “start”, and select “Launch” option, you can change the size of emulator by changing “Screen Size” option, (change screen size  to 5)








Now it will start emulator.
Every time you open eclipse you have to start this emulator, but creation is only once, and you can create more than one emulator (AVD)


Now you can start with your first application, select “file”->”New”->”Other”->”Android project”




“Next >”, now fill all the required information as, Project name “HelloApp”, Select target to “Android 2.2”, Package name to “com.example.helloapp”, then finally “Finish”,




Following is a final structure,


“src” contains your package which contains all .java files, called Activity, “gen” folder contains “R.java” which is created automatically, it creates static final member for all your components like string,  buttons, images, music files etc.
Main.xml is a layout file and string.xml contains strings, you need to edit these file as per your application, and “AndroidManifest.xml” file contains activity class names and user permissions, suppose your applicaton is about location, then you have to mention appropriate permissions here in this file.
Now run that application, right click on your project,



Now examine your emulator,






That’s it……All the best…..

You can go through offline guide for application development.
Just follow the path as ”androidsdk->docs->index.html”





















No comments:

Post a Comment