Monday, July 2, 2012

creating your First Android Application

To Download  Full Program    Click Here

STEP 1:  Open Eclipse   -->   Click File


STEP 2:     Click new -->  project

STEP 3:     Select Android Project --> Click next

STEP 4:    Enter project Name   --> Click Next 


STEP 5:  Select the Version    --->  Click Next

STEP 5:  Enter the package name    --->  Click Next

note: package name must have one dot with two names 

example :   (     (s.s)     (         (s.s.s)           etc...

STEP 6: See the project Explorer window, project is present there. If project Explorer not open,        Click Window --> show view --> project Explorer

STEP 7:  Expand your project

STEP 8:  Expand res folder in your project

STEP 9:  Expand layout folder 

STEP 10:  open main.xml 

Main.xml have two views.

1.Graphical layout   : In this we can do drag and drop controls here.  xml codes
 generated automatically  while designing in graphical layout.

2.main.xml                : In this We can write xml codings here for generating and aligning controls here.

(Those two tabs present in left below of black screen)

STEP 11:  click main.xml  tab.

STEP 12:  Delete all codings in main.xml and add following codings.
                   (put double quotes correctly in the xml program) 

 <?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android=""
android:layout_height="fill_parent" >

android:text="@string/hello" />

android:text="This is my first Android Application!" />

android:text="And this is a clickable button!" />


then click  Graphical Layout  tab.


In this line,  @string refers a file. This file present in res --> values --> Strings.xml

Open Strings.xml -->  It have two tabs.  1. Resources   2. strings.xml 

Click strings.xml tab.



hello represents   Hello World, HelloworldActivity!
app_name represents projectname

STEP 13:  click Save all  ( ctrl+shift+s)

STEP 14:  click run  ( Ctrl +F11)

 select Android Application.


click home button

Then click Application launcher button.

Note  that the HelloWorld application is now installed in the application launcher

To Download  Full Program    Click Here

thank you... If you have doubt, feel free to ask and post here..

1 comment: