Sunteți pe pagina 1din 33

Android Application Development

MOBILE OS
Symbian(.sis) By Nokia iOS(.app) in Apples iPhone RIM's BlackBerry(.cod) Windows mobile(.cab) by Microsoft Android(.apk) by Google J2ME(.jar)

WHAT IS ANDROID ?
A software stack for handheld devices (like mobile, Tablet computers) that includes an operating system, middleware and key applications based on the Linux kernel. Developed by the OPEN HANDSET ALLIANCE(OHA) lead by Google in Aug 17, 2005.

2007 Nov 12: Android SDK released by OHA (a consortium of 86 hardware, software, and telecommunication companies like: Google, HTC, Intel, Motorola, T-Mobile etc)
Java programming/Native programming.

WHY ANDROID ?
A simple and powerful SDK No licensing, distribution, or development fees Development over many platform Linux, Mac OS, windows etc. Thriving developer community

ANDROID FEATURES
GSM, EDGE, and 4G networks, WiFi, Bluetooth API Support for Bluetooth, WiFi Ad hoc mode.
Hardware control: Accelerometer, digital compass, microphone, camera, GPS (Best-Google Maps), tracks a user movement as he/she changes his/her location.

Mash up Capability
It combines two or more service to create an application. Eg . Barcode Scanner: ZXing Teams free Barcode Scanner app. 1) GPS + Camera. 2) 2D(SGL)+3D(Open GL/ES) 3) Text Editor + Camera. ranked 4.5 out of 5 stars based on the reviews of over 100,000 users.

Architecture of Android.

Linux 2.6 kernel (designed in C)


Security model: Its handles security between the application and the system. Memory management: Its handles memory management for you, leaving you free to develop your app with the help of Process Management.
Network stack: Its handles network communication.

Android Libraries (in C & C++)


The Android run time: The Android run time is composed of Java core libraries( Collection classes, utilities, io etc) and the Dalvik Virtual Machine, runs dex file (enhanced byte code).DVM is memory efficient, & multiple instances of it can run on the device at the same time. Surface Manager: Manage difference windows for different applications Media frameworks: These libraries allow you to play and record audio and video. SQLite: Embedded relational light weighted database.
(Core Lib in Java)

OpenGL|ES: 3D image engine. SGL: 2d image graphics. In the same application we can use both 2D & 3D FreeType: Bitmap and Vector WebKit: This open-source Web browser engine provides the functionality to display Web content and simplify page loading. Secure Sockets Layer (SSL): These libraries are responsible for Internet security. Libc: c standard lib.

Application framework (written in Java)

The application framework provides the classes used to create any Android applications.
Activity manager: Manages the activity life cycle. Package Manager: keeps track of installed applications.

Content provider: Framework to allow the sharing of data among applications. Eg. Phone nos, names etc are allowed to be used by sms application. Window manager: manages window Telephony manager :contains api that we use to build the phone application thats central to the phone experience.

Resource Manager: to store localized string, bitmaps, & external parts used to create applications . Ex. Images, audio/video etc.

Location Manager

Installing and Configuring Your Support Tools


Java JDK: Lays the foundation for the Android SDK.

Android SDK: Provides access to Android libraries and allows you to develop your application.

Eclipse IDE (integrated development environment): Brings together Java, the Android SDK, and the Android ADT (Android Development Tools), and provides tools for you to write your Android programs

Eclipse IDE + ADT (Android Development Tools) plugin (or NetBeans + NBAndroid P-in)
Reduces Development and Testing Time. Makes User Interface-Creation easier. Makes Application Description Easier.

Programming Language(s)
Java officially supported.(JDK) C/C++ also possible but tedious & inefficient.(Native Dev Kit)

Steps to Create an Android Project


Install jdkAndroid SDK in your system. Install Android Development Tools (ADT) plugin inside eclipse. Provide Android-SDK path in window->preferences in eclipse. From File menu, Select New->Project->Android Project. Specify the package name. Select the version of android. Click on finish. The project will be displayed in eclipse.

https://dl-ssl.google.com/android/eclipse

Application APIs
J2SE java.util.* java.io.* java.lang.* etc android.widget.* android.view.* android.graphics.* android.telephony.IPhone android.telephony.gsm.SmsManager android.webkit.WebView

UI

Telephony SMS Web

Application APIs
Camera
Local database

android.hardware.CameraDevice
android.database.*

Maps
Location

com.google.android.maps.MapView
android.location.LocationManager

Multimedia
HTTP

android.media.MediaPlayer
org.apache.http.client.*

Java Code
Initialize
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.screen); }

Java Application

Android with java

JVM
More Battery Consumption More Memory consumption Stack based VM Efficient on single instance of JVM OS takes care of task priorities.

DVM
Less Battery Consumption Lesser memory consumption Register based VM(faster) More efficient when running multiple instances of the DVM. Phone functionality is priority #1

A Detailed Look at the Build Process

Explanation: The Android Asset Packaging Tool (aapt) takes your application resource files, such as the AndroidMainfest.xml file and the XML files for your Activities, and compiles them. An R.java is also produced so you can reference your resources from your Java code. The aidl tool converts any .aidl interfaces that you have into Java interfaces. All of your Java codes are compiled by the Java compiler and .class files are output. The dex tool converts the .class files to Dalvik byte code. Any 3rd party libraries and .class files that you have included in your project are also converted into .dex files so that they can be packaged into the final .apk file.

All non-compiled resources (such as images), compiled resources, and the .dex files are sent to the apkbuilder tool to be packaged into an .apk file.

Once the .apk is built, it must be signed with either a debug or release key before it can be installed to a device.
Finally, if the application is being signed in release mode, you must align the .apk with the zipalign tool. Aligning the final .apk decreases memory usage when the application is running on a device.

THANK YOU
Any Queries????

S-ar putea să vă placă și