First Android App
Requirement
Eclipse IDE with SDKs installed.
Getting Started !!!
Start your Eclipse by clicking on eclipse.exe file. It might take some while to start. Please pay attention to right bottom corner. Do not do anything until everything is finished loading.
The Development corner looks some-what like this :
Above is a typical Eclipse Window.
In the above image, you can see in the right corner, Building workspace (67%). Please wait for this loading to complete.
The Eclipse Window
After completion, you are ready to make your first app.
- Right Click in Project Explorer as shown beside.
- Select New > Project
- Select Android Application Project and click on Next
- Now, a dialog box will open and will ask you for name of project that you are willing to build.
New Android App Window
- Add your application name. The name by which your app will be identified.
- Give a name to your project.
- The Package Name is collection of files of your app. Whenever you will update your app, your app will be identified by package name.
- Should be " in.application_name " .
- Please remove " com.example ".
Configuration Dialog Box
- Click on Next and you will enter the Configuration window.
- Do not make any changes in this dialog box.
- Click Next.
- Select your " icon ".
- Click on Browse and locate your image you would like as your logo.
- High resolution images/icons are good.
- Click Next.
- Next Window is the Activity Window.
- Select Blank Activity
- Click on Finish.
After completion of prerequisites, this is how your window will look like :
- Right click on project name in Project Explorer and select Export.
- Select Export Android Application and click Next.
- Select the project and click Next.
Keystroke
A Keystroke is a certificate provided by eclipse as a Copyright of your app.
- Click on Create New Keystroke.
- Browse to the location you want your keystroke to be placed.
- Create a password and click on Next.
- Type in your details and click Next.
- Select the location where you want your app to be placed and click finish.
- It might take some time to build the apk file.
Woaallaa !!! Send the app to your android phone, install it and then run it.
You are through to your first android app.
EMULATOR
An emulator is a demo device provided by Eclipse IDE. Here, you can test your app before running it on actual device.
- Right click on project name in Project Explorer and select Run As.
- Select Android Application.
- A window window will pop-us asking you to set-up a Virtual Device.
- Click on Create.
- Give your Android Virtual Device a name.
- Select Nexus 4 as device.
- Select WVGA800 as your skin.
- Change internal storage to 2000MB
- Click on OK.
- Your AVD should start and after some time (3-4 minutes), it will run your app.
- The AVD look something like this :
The Coding Part
Relative layout is the type of layout of your app. Never use relative layout. Instead, use Scroll or list view.
The Text View is a widget that helps you type text.
super.onCreate is the function called when your app starts. It means On Creation Of Activity.
An activity is the instances in your app transition between different states.
SetContentView sets the content view of your app.
This bring us to the completion of First Android App Tutorial. I hope you have understood the basics and you can contact for more information
No comments:
Post a Comment