Edumobile: Beginning Your Android Programming Journey
Edumobile: Beginning Your Android Programming Journey
.org
The authors and publisher of this book have used their best efforts in
preparing this material. The authors and publisher make no representation
or warranties with respect to the accuracy, applicability, fitness, or
completeness of the contents of this program.
As per the NPD group the unit sales Android phones is the largest among
Smart Phones.
Being an open system based on modified Linux kernel it has been widely
accepted by the developer community and presents a golden
opportunity to create products and services for this amazing platform.
Nokia started the SmartPhone revolution earlier this decade, since then
the SmartPhones market has grown from strength to strength. However,
with Nokia’s Symbian OS quickly loosing market share - Blackberry,
Android and iPhone are now are the biggest players in the industry.
Android being open source and a wide hardware support is quickly
gaining ground for smart phones as well as netbooks and recently,
tablet PCs
Android 2.1 has finally reached a point where it is ready for the mass
market. Nexus One with the next release 2.2, AKA Froyo will also soon
gain rapid market adoption.
Android 1.0
Android 1.1
Android 1.5
Android 1.6
Android 2.1
Android 2.2
API Level is an integer value that uniquely identifies the framework API
revision offered by a version of the Android platform. The Android
platform provides a framework API that applications can use to interact
with the underlying Android system. The framework API consists of:
The above data will give you a peek into the marketplace for which
you will create products.
We will limit our discussion in this book only for Application level
programming for Android and Android Marketplace. The System level
programming is out of the scope of this free ebook and if you want to
jump right into it, you should perhaps start with C and Linux kernel
programming.
Link - http://download.oracle.com/javase/tutorial/
XML – You should know what the XML standard is all about and how it is
used in software applications.
Link - http://www.w3schools.com/xml/default.asp
Eclipse – If you have worked in any IDE for Java you should be ok with
eclipse. You can read more about it here.
Link - http://www.vogella.de/articles/Eclipse/article.html
Link - http://download.oracle.com/javase/tutorial/java/concepts/
Please follow the steps mentioned below to install Android SDK and
eclipse IDE to get started with application development.
http://www.oracle.com/technetwork/java/javase/downloads/in
dex.html
You can use any eclipse IDE above 3.4 but you should always use
the latest version.
Note: Make sure you first install the JDK before installing the
Eclipse.
Google Recommends
Operating Systems
Caution: There are known issues with the ADT plugin running
with Eclipse 3.6. Please stay on 3.5 until further notice.
Hardware requirements
The Android SDK requires disk storage for all of the components that
you choose to install. The table below provides a rough idea of the
disk-space requirements to expect, based on the components that you
plan to use.
Once you have your system ready you need to download the Android
Starter package. The starter package is not a full development
environment — it includes only the core SDK Tools, which you can use
to download the rest of the SDK components. You can get the latest
version of the SDK starter package from the
Link - http://developer.android.com/sdk/index.html
If you have trouble acquiring the plugin, you can try using "http"
in the URL, instead of "https" (https is preferred for security
reasons.
Click OK.
Once you've downloaded ADT the next step is to modify your ADT
preferences in Eclipse to point to the Android SDK directory:
If you are developing in Eclipse and have already installed the ADT
Plugin, follow these steps to access the Android SDK and AVD Manager
tool:
1. Open Eclipse
2. Select Window > Android SDK and AVD Manager.
3. Select Available Packages in the left panel. This will reveal all
of the components that are currently available for download
from the SDK repository.
Now our system is ready for work. Start your eclipse and create a
work directory if not already created.
The left side of the UI shows the projects created by you. The
central UI will show the code written by you and the right end of the
figure shows the task lists. The lower end of it shows the console
and logger which is very useful while debugging.
package org.hello.HelloAndroid;
import android.app.Activity;
import android.os.Bundle;
main.xml
strings.xml
AndroidManifest.xml
</application>
</manifest>
It is easy to compile the code and run the device simulator associated
with the SDK.
Click on the “Run As” as shown in the figure above. A selection window
appears as shown below. Select the Android Application from it.
Once you press ok your code will start compiling and your simulator will
start.
Click on the “menu” key on the simulator and you can see the result of
the application.
This example of ours was very basic but it still is a complete Android
Application and you can take some time to grasp the structure and
basic aspects of an Android Application. Let us in the meantime try and
modify this program of ours and put some other text in the output
screen.
Open the strings.xml of your project and make the following changes
Save your project and run your project once again. You should now see
the following
Go through all the java and xml files for the project before you move
ahead.
4. A Bit Of Theory
Let us now go through some important features of Android and see how
they are linked and provides application developers powerful
environment to work in. It primarily consists of a stack of operating
system, middleware and key applications which can be summarized as
follows
Linux Kernel – Android uses linux kernel for hardware management and
providing hardware abstraction to the rest of the software stack.
This was a small step in our journey towards getting started with
Android development. If you are interested in mastering NAdroid
Development, we suggest you sign up for our complete 12 Week
Android Programming Course at the link below. It comes with a full
money back guarantee, so there is no risk at all.
You will be assigned your own personal one-on-one tutor, whom you
may consult any time with questions and problems you face.
You will also get access to our private forum where you can meet
other fellow Android developers.
Click Here To Learn More About The Android Course and To Enroll
Affiliates Join Our High Paying Affiliate Program and Make Tons Of
Money!
Interested in promoting our Courses and making money?
Get instant $25 bonus for signing up!