Sunday 20 November 2011

How to Create and Run Your First Android Project

,
This post explains how to create and run an Android project on Eclipse 3.5 (Galileo) in windows environment.

Once you have configured your system for android development and set up an Emulator to see your output, you can start creating your first Android project. Here I explained how to create a new android project in Eclipse and to see its output using the emulator we created before

Creating the project


From the menu in Eclipse select File->New->Android Project.


In the "New Project" window appears, give a valid project name and click on the Next button. 


Choose a target SDK and click the Next button.

Please note: If you have installed the SDK s using SDK manager and none got displayed here, then please go to Windows->Preferences and select Android option and mention the correct SDK location and click ok.


In the next window, give a proper package name and click on the finish button.  Make sure that you checked the “Create Activity” check box, since here we are planning to create an UI application. That’s it. You have created your first Android project. 



Once your project is created, you could see these files in the package explorer console of Eclipse. 


Running the project

Step1: Launch the Emulator from AVD manager. (please refer How to create a virtual device to view how to launch ). Please Note: Emulator should have same or higher target SDK than the project you created.  

Step 2: Select Run->Run Configuration from the menu and launch the Run Configuration dialog.




Inside the dialog, double click on “Android Application” to launch a new Configuration console. Give a name to the configuration and in the Android tab browse your project (MyFirstPrj). 


Now select the Target tab and Select Automatic and choose our created AVD and click the Run button.



Then, you application will be installed in already launched Emulator and it will run automatically an you will see an output like this.




Cheers,
Have a nice day. View Complete List of Tips




0 comments to “How to Create and Run Your First Android Project”

Post a Comment

 

Tips for Android Developers Copyright © 2011 -- Powered by Blogger