Friday 18 November 2016

How to Start with Android development

Nowadays Mobiles and tablet PC’s have taken place of laptops and traditional PC’s. And Android is very exciting and prominent OS in mobile market. It’s very important for young developers use their sdk to develop exiting apps.

Few software are needed for Development of android apps. Eclipse, Android sdk and Android development toolkit.

Download links


(1) Now Google started to provide all 3 Softwares as bundle. So only 1 zip file is needed to be downloaded. Download it by going to this link. http://developer.android.com/sdk/index.html

This link will help you regarding downloading and installing The ADT bundle. http://developer.android.com/sdk/installing/bundle.html

Steps to develop First Android App

(1) Open the adt-bundle-/eclipse/directory and launch eclipse.

(2) Go to File –> New –> Android Project.

(3) Write the details as explained below. See screenshot Number 1 for details. Enter below details.

Project Name :- Any suitable name for your project
Build Target :- For which platform you want to develop your android app
Application Name: – it can be same as project name or can be other.
Package Name :- All android applications are distinguished by this name only. So Give unique package name.
Activity Name :- Name of the first activity to be launched when Android application starts
Min SDK Version :- API Level of Android sdk version.

Now click on Finish.


(4) Now first Go to Project –> Clean and clean the project. That will generate required R.java file.
See screenshot 2 for this step.

(5) Now to see how your App will run in android Phones, You need to configure emulator for that.

Go to Window–>Android SDK and AVD manager–>click on new.(See screenshot 3). Enter below details.
Name :- Any suitable name
Target :- For the target you are developing app
Size of sd card :- If you want to allot memory to Sd card of emulator.

Click on Create AVD.

(6) Now select the AVD you created shown in screenshot and start and Launch it. It will take time to launch it.


(Screenshot 1)


(Screenshot 2)

(Screenshot 3)

(Screenshot 4)
(7) Now right click on
the Project in package explorer. And Run ASà Android Application.
See the
screenshot.




(Screenshot 5)

Useful Files

(1) Res -> layout –>main.xml


Set the layout of first activity. User interface of android applications should be in layout folder.
(2) Gen –>R.java



Auto Generated file. Make sure you don’t mess with it. Don’t edit it.
(3) TutorialApp.java
You can code in this file. Like What action button should perform, Create menu and all.


Simple Application


(1) Go to main.xml–>click on layout shown in screenshot. Then click on + button shown in screenshot and add button and textview there.

(2) Go to Window
–>Show view

–>other. Now broaden General and select properties. Now change the properties of button like its name, size and other things. See the screenshot 7.
(3) Now Go to Your Java file. Update the code as shown in screenshot 7 and 8 and run the android application again.
(4) You can see the output as Screenshot 9.


(Screenshot 6)


(Screenshot 7)


(Screenshot 8)


(Screenshot 9)

You have successfully developed first basic android app. You can find .apk file in project/bin folder.

No comments:

Post a Comment