Monday, 26 November 2012

How to create simple app in Android

Hello Dear Freinds ,
                   Today i gonna teach you how to grip on the actual android apps development. we can develop an app on Windows, Linux as well as Mac OS.
 for being an android developer, you needs to have healthy command on Java.

*What is Java ?
   java is an object oriented programming language. it is stronger languages because it is stand on the three magical pillar, Encapsulation, Polymorphism, & Inheritance .

*Role of Java in android :
    Android applications are written in a well-respected programming language: Java.The Android application framework includes traditional programming constructs,such as threads and processes and specially designed data structures to encapsulate objects commonly used in mobile applications. Developers can rely on familiar class libraries, such as and java.text. Specialty libraries for tasks like graphics and database management are implemented using well-defined open standards like OpenGL Embedded Systems (OpenGL ES) or SQLite. Each Android application runs in a separate process, with its own instance of the Dalvik virtual machine (VM). Based on the Java VM, the Dalvik design has been optimized for
mobile devices.The Dalvik VM has a small memory footprint and multiple instances of the Dalvik VM can run concurrently on the handset.

if you are good in java,then android is waiting for you, lets play........

*Software Requirement for :
v                   *Java sdk
v                   *android sdk
v                   *ecilpse(helios is recommanded, now juno is availible on )
v                    *ADT pluggin

1Downloaappropriate file for your system from 
2)      Extract to desired location
3)      Run “SDK Setup.exe” (or the equivalent for your system)

Launch sdksetup.ext
a.       If you receive an error message stating “Failed to fetch url…” then you will have to force the Setup program to use http in lieu of https.

Got this error? Follow the steps.
i.      Close the “Refresh Sources” window
ii.      Cancel the “Choose Packages to Install” window
iii.      Select “Settings” from the left side of the “Android SDK and AVD Manager” window
iv.      Check the box labeled “Force https://… sources to be fetched using http://…”
v.      Click “Save and Apply”
vi.      Close and restart the SDK Setup program
4)      Choose the packages that you wish install

Select only the packages you need.
a.       If you are only interested in trying out the Android 2.0 Emulator
i.      Reject everything except “SDK Platform Android 2.3. API 9, revision 1” by selecting each item then selecting the Reject option
b.      If you plan to develop Android applications and Games, you may wish to Accept All
c.       Click “Install Selected”
5)      Allow the selected packages to download and install then close the “Installing Archives” window
6)      Create a new Android Virtual Device (AVD)

These are the settings to emulate the Moto Droid.
a.       Select “Virtual Devices” from the left side of the “Android SDK and AVD Manager” window
i.      Click “New”
ii.      Enter a Name
iii.      Choose a Target – Android 2.3
iv.      Enter a size for the emulated SD Card
v.      Choose a Skin
1.      To emulate current hardware such as the G1, MyTouch 3G, Hero, etc…
a.       Leave the default value
2.      To emulate the  Android 2.0
a.       Choose WVGA 854
3.      To emulate other devices
a.       Choose anything else
vi.      Click “Create AVD”
7)      Start your newly created Virtual Device

A successfully created AVD.
a.       Choose the Virtual Device from the list
b.      Click “Start…”
c.       Click “Launch”

Just click launch.
8)      Allow copious time for Emulator to start up

First startup will take a few minutes.
9)      Enjoy!

Android 2.0

Programming on Ecilpse
1.       First install eclipse on your machine with your desirable workspace.

2.       After that,(help->install new software
3.       Add  ADT-Pluggin (zip file) which you have downloaded before

Install all above,so eclipse can be actually getting ready for android development.
4.       Click on (window->preference->Android)  to, set target path for AVDs,that we have created .

Simple Hello Program.
1.create an Android Project in your project Explore.;with name of Simple_app.
(File->new->other->android project)

                2. choose target program as well as  assign package name.

3. Run program as (Android Application)
& output will look like as…………..

& enjoy ,Happy coding………….. J

No comments:

Post a Comment