Articles → Android → Create Your First Android Application

Create Your First Android Application






Software Requirement




  1. JDK (latest version) is installed on your machine
  2. Android SDK is installed on your machine
  3. Eclipse 3.6.2 or greater is installed on your machine
  4. ADT (Advanced Development ToolKit) is configured on your machine.

Prerequisite Knowledge





Create Your First Application




  1. Open eclipse
  2. Click on File menu – New – Project
  3. Picture showing the Project menu for creating the new project
    Click to Enlarge

  4. A window appears as shown in figure below
  5. Picture showing the wizard window for selecting the project type
    Click to Enlarge

  6. Select ‘Android Application Project’. Click ‘Next’. A window appears as shown in figure below
  7. Picture showing a wizard window for entering the project name
    Click to Enlarge

  8. Enter Application Name and click on ‘Next’. A window appears as shown in figure below.
  9. Picture showing a wizard window for selecting the activity type for the project
    Click to Enlarge

  10. Click on ‘Next’ and a window appears as shown in figure below.
  11. Picture showing the final screen of the wizard for creating the new project
    Click to Enlarge



  12. Click Finish. Once click on ‘Finish’ a project is created.

Project Structure


Picture showing the project structure of your first application in android
Click to Enlarge



  1. src - The src folder contains the source code files of your application. In the project we have one file with the name ‘MainActivity.Java’ (This is the activity name which we have given when we created the project). See the screen shot below for src folder.
  2. Picture showing the source code files in th folder and the code of MainActivity.java file
    Click to Enlarge



  3. Secondly we have layout file i.e. activity_main.xml which is inside the res folder.
  4. Picture showing the tab for checking the tags of the UI element
    Click to Enlarge

  5. Android 4.1 – The version number in the folder name is same as the build target version of android application.
  6. We have AndroidManifest.xml file which contains information about the project like package name, activities etc. There are many other information but we are not covering all information in a single tutorial. See the screen shot below for AndroidManifest.xml
  7. Picture showing the UI tags in the android application
    Click to Enlarge



Output




Picture showing the output of your first android application
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, March 14, 2013

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250