This document provides an overview of Android application development. It discusses the history and architecture of the Android operating system. It also describes the development environment, activities, intents, and life cycle of Android applications. Additionally, it explains the differences between native and hybrid Android applications and provides code samples for configuring the development tools and creating a basic hybrid app.
2. ANDROID APPLICATION DEVELOPMENT
• Introduction to Android Operating System
• History of Android
• Android Versions
• System Architecture of Android.
• Android Application Programming
• Android Life Cycle
• Introduction to Development Environment
• ADT with ECLIPSE
• Android Studio
• Android Layouts
• Android Components
• Android Activity
• Android Manifest file Description
• Deployment of Application to .apk file
• Sample Native Android Application
• Sample Hybrid Android Application
3. INTRODUCTION
Android is a mobile operating system (OS) based on the Linux kernel and currently developed
by Google. With a user interface based on direct manipulation, Android is designed primarily
for touchscreen mobile devices such as smartphones and tablet computers, with specialized
user interfaces for televisions (Android TV), cars (Android Auto), and wrist watches (Android
Wear).
• Written in : C(core) , C++ and JAVA (UI).
• Initial Release : 23rd September 2008 Android Basic.
• Latest Release : 21st April 2015 “Android 5.1.1” Lollipop.
• Latest Preview : 17th August 2015 “Android 6.0” Marshmallow.
• Language Support : 70+ Languages.
• Package Manager : Google Play and .APK
• Hardware Platform : 32 & 64 bit ARM architecture, MIPS and MIPS64.
• Kernel : Monolithic
• License : Apache License 2.0 GNU GPL.
• Official Website : www.android.com
4. HISTORY OF ANDROID OS
• The first commercial version, Android 1.0, was released in September 2008. Android is under
ongoing development by Google and the Open Handset Alliance (OHA), and has seen a
number of updates to its base operating system since its initial release.
• Android versions have been developed under a confectionery-themed code name and
released in alphabetical order, beginning with Android 1.5 "Cupcake"; the earlier versions 1.0
and 1.1 were not released under specific code names:
• Cupcake (1.5)
• Donut (1.6)
• Eclair (2.0–2.1)
• Froyo (2.2–2.2.3)
• Gingerbread (2.3–2.3.7)
• Honeycomb (3.0–3.2.6)
• Ice Cream Sandwich (4.0–4.0.4)
• Jelly Bean (4.1–4.3.1)
• KitKat (4.4–4.4.4, 4.4W–4.4W.2)
• Lollipop (5.0–5.1.1)
• Marshmallow (developer preview 3)
7. DEVELOPMENT ENVIRONMENT
• There is many way for developing android application
• Android Development Toolkit (ADT) integrated with Eclipse IDE.
• Android Own Development IDE i.e. Android Studio.
• NDK for native code using C/C++ Language mostly use for Game
Engine.
• Basic4Android for VB Developer.
8. STEP TO CONFIGURE ADT FOR ECLIPSE
• First Download JDK 1.7 or above
• Set Environment Variables
• JAVA_HOME : jre path ( C:/ProgramFiles/java/jre7/bin; )
• PATH : jdk path (C:/ProgramFiles/java/jdk1.7/bin; )
• Download Eclipse from www.eclipse.org
• Download ADT Bundle from developer.android.com > tools > downloads > ADT for Eclipse
• Open Eclipse > Go to Help Menu > Click Install New Software
• Click on Add button located on upper right corner
• Click on archive and select Downloaded ADT Zip/Rar from directory.
• Give Name as Android Plugin. And click next
9. STEP TO CONFIGURE ANDROID STUDIO
• Android Studio is Platform for sdk by intelliJ
• Download and install JDK 1.7
• Set Environment Variables
• JAVA_HOME : jre path ( C:/ProgramFiles/java/jre7/bin;)
• PATH : jdk path (C:/ProgramFiles/java/jdk1.7/bin; )
• Download Android Studio from developer.android.com > tools and install it
12. ANDROID ACTIVITY
• Every UI screen of android application is known an Activity.
• When java class extends with Activity class known as Android activity.
• Execution of code should started after onCreate() method get invoked, at starting of activity class by default onCreate()
method get invoked.
• XML Layout get mapped in onCreate() method as follow.
• Example :
Public class MainActivity extends Activity{
@override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView( R.layout.main) ; //XML Layout named as main.xml get mapped with MainActivity.class with this
}
13. CLICK EVENT
• For click event in android we use setOnClickListener() method where overrided onClick() method is passed as
parameter.
• Example :
Button b = (Button) findViewById (R.id.button1); // get access of button from XML Layout
b.setOnClickListener(new onClickLestener(){
@override
Public void onClick(View v){
//Code whatever want to do after clicking on button
}
});
onClickListener method can also use for TextView, ImageView or with any components.
14. INTENTS
• Intents are used to launch another activity from one activity. Or switch between two activities.
• Syntax:
• Intent <variable>=new Intent( currentActivity.this , nextActivity.class);
• startActivity(<variable>)
• Example:
• Intent I = new Intent( MainActivity.this , SecondActivity.this );
• startActivity( I );
15. NATIVE VS HYBRID APPLICATION
• Hybrid Application allows developer to use their Web Application as a android application.
• Hybrid Application allows developer to use it to any platform of OS instead of developing program for
all OS. i.e. Same code use for Android , iOS or for Windows.
• For static program native application is better option but for cloud base and Dynamic Web Application
hybrid Application is better option
• Follow next code for Hybrid Application Development
16. HYBRID APPLICATION
• Step 1 : Get WebView from widget in main.xml
• Step 2 : set webview height and width as match_parent from properties
• Step 3 : set padding as 0 for grasp screen size of android device.
• Step 4 : then map webview in Activity class using following line of code
• WebView w=(WebView)findViewById(R.id.webView1)
• Step 5: load url into WebView using following line of code
• w.loadUrl(“http://www.google.com”); //for access website through internet
OR
• w.loadUrl(“file:///android_asset/ProjectFolder/index.html”); //located in android asset folder
• Step 6 : To unable JavaScript in webView
WebSetting ws= w.getSettingd();
ws.setJavaScriptEnabled(true);
• Step 7 : Finally need to get Internet permission to access websites from internet so add following code into
AndroidManifest.xml file after opening of <manifest> tag
• <uses-permission android:name=“android.permission.INTERNET”>
17. FOR ANY QUERY
-Mail on-
yogesh.lakhole@gmail.com
Or
astutesoftwares@gmail.com