Workshop by T.Naveen sai kumar
Why to choose android ?
Foundation of android Founded by Andy Rubin in year 2003. Google acquired Android ,Inc. – August 2005. The open handset alliance, a group of several companies was formed – 5th November 2007 Android SDK Released – 12th November 2007.
Code name Version number Initial release date API level N/A 1.0 23 September 2008 1 1.1 9 February 2009 2 Cupcake 1.5 27 April 2009 3 Donut 1.6 15 September 2009 4 Eclair 2.0 – 2.1 26 October 2009 5–7 Froyo 2.2 – 2.2.3 20 May 2010 8 Gingerbread 2.3 – 2.3.7 6 December 2010 9–10 Honeycomb 3.0 – 3.2.6 22 February 2011 11–13 Ice Cream Sandwich 4.0 – 4.0.4 18 October 2011 14–15 Jelly Bean 4.1 – 4.3.1 9 July 2012 16–18 KitKat 4.4 – 4.4.4 31 October 2013 19–20 Lollipop 5.0 – 5.1.1 12 November 2014 21–22 Marshmallow 6.0 – 6.0.1 5 October 2015 23 Nougat 7.0 22 August 2016 24
Introduction of android An open source Linux-based operating system intended for mobile computing platforms Includes a Java API for developing applications It is not a device or product , it is platform or environment to run applications.
Advantages & disadvantages Multitasking Easy of Notifications Easy access to thousands of applications via the Google Android Android App Market Can install a modified ROM Widget Voice typing and actions Support VGA,2D & 3D. *** Disadvantages Continuous Internet connection Advertising
Android architecture
Why android & not ios ? Android OS We can set any app as a default on Android. Android just drag & drop for syncing by using USB cable on computer/Lp While Google Charges for android develpoer only $5 Android OS have Flash support iPhone OS It is impossible on iPhone. Have to click manually. iPhone syncing only with iTunes Apple charges for the App developers $100 While the iPhone only has html5 support
Android Components There are 4 basic components of an Android Application : Activity Service Broadcast Receiver Content Provider
activity An Activity represents a single screen with UI. Activity class takes care of creating a window in which UI can be placed with the method setContentView(View) While activities are often presented as full screen windows, they can also be used as floating windows or embedded inside another activity. The onCreate(Bundle) is where you initialize your activity. All activity classes must have a corresponding <activity> declaration in their package’s AndroidManifest.xml
Intent receiver They listen to broadcast intents. They must be registered (either in code or within the AndroidManifest.xml). Intent Filters must be used to specify which Intents it is listening for. A broadcast receiver can be registered using multiple intent filters. The onReceive() method be overridden to perform any operations.
service A Service is a component that runs in the background to perform long-running operations or to perform wok for remote processes. Each service class must have a corresponding <service> declaration in its package’s AndroidManifest.xml A service does not provide user interface. Another component, such as an activity, can start the service and let it run or bind to it in order to interact with it.
Content provider Content providers are one of the primary building blocks of Android applications, providing content to applications. They encapsulate data & provide it to applications through a single interface called ContentResolver. A content provider is only required if there us a need to share data between multiple applications. For example, the contacts data is used by multiple applications & must be stored in a content provider.
Android manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.wearable.timer" > <uses-sdk android:minSdkVersion="20" android:targetSdkVersion="22" /> <uses-feature android:name="android.hardware.type.watch" /> <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.DeviceDefault.Light" android:allowBackup="true"> <!-- Timer components --> <activity android:name=".SetTimerActivity"> <intent-filter> <action android:name="com.android.example.clockwork.timer.TIMER"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> <!-- Set a timer voice command --> <intent-filter> <action android:name="android.intent.action.SET_TIMER"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> <service android:name=".TimerNotificationService" /> </application> </manifest>
Android life cycle
Best Ide’s for android
Ide’s for android AIDE (Android IDE) HTML5/C/C++ Application Craft Basic4Android BASIC Cordova Corona Lua Intel XDK IntelliJIDEA Java Kivy Python MIT App Inventor Blocks Monkey X MonoGame C# MoSync NS BASIC PhoneGap RAD Studio XE Object Pascal, C++ RFO Basic RhoMobile Suite Ruby Telerik Titanium JavaScript Xamarin