Friday, 26 February 2016

Android Application

Android Application Component

In order to build android application we need to combine multiple blocks those are called building blocks. All the building blocks of android are listed below –
ComponentsDescription
ActivitiesThese are used to handle any user interface activity and its interaction with android device
ServicesServices are used to handle any background processing associated with an application.
Broadcast ReceiversBroadcast Receivers are used to handle communication between Android OS and applications.
Content ProvidersContent providers handle data and database management related things.

Android Hello World : Example Application

Now we are listing out all the steps to create android application using the eclipse. Firstly you need to right click inside the blank area of package explorer and then select New -> Android Application Project
Step 1 - Create new android project
Now after selecting the android application project we need to give proper name to android app. You need to change the default package name otherwise eclipse will throw warning message
You need to select the minimum required SDK to create your app compatible with older versions of android. Plese make sure that you will compile your app with latest version of android so that it will be compatible with newer versions of android
Step 2 - Give name to new android project
Now keep these setting as default for this hello application
Step 3 - New application
Now if you want to change the default icon of android app then you can choose icon otherwise you can keep it as default for practice app
Step 4 - Configure icon
keep these setting as default for this hello application
Step 5 - Create Activity
keep these setting as default for this hello application
Step 6 - Blank Activity
Step 7 - Finishing
In order to run the project you need to right click on the project name and run project as android application.
Step 8 - Running Project
In our case we have connected android device to computer using USB cable so it will prompt us below window. We have chosen android device to run our project.
Step 9 - Run on Android Device
Below output will be displayed when you run android project
Step 10 - Run on Android Device

No comments:

Post a Comment