Android Development Basics Bruce Crawford Global Solutions Manager
Android Development Environment Setup
Agenda Install Java JDK Install Android SDK Add Android SDK packages with Android SDK manager Install Eclipse Install ADT Install AVD Develop Enterprise Android Motorola Android Extensions for Enterprise (MX) 2:30 3:30 Android Fundamentals Android System and Programming Overview 3:30 4:30
Android Links LaunchPad : http://developer.motorolasolutions.com Android Developer Site : http://developer.android.com Q&Q Community : http://stackexchange.com End User Q&A : http://android.stackexchange.com Detailed Tutorials : http://vogella.com/android.html
Types of Android Applications Development Language Dev Kit Runtime Environment Java SDK Dalvik Virtual Machine C/ C++ NDK HTML5, Javascript, CSS N/A Native, usuallyinvoked from Dalvik Android Web Browser Java is the normal way to develop Android applications C and C++ Performance Legacy C/C++ code HTML5, RhoMobile
Android Development Tools http://developer.android.com SDK System Requirements (~200MB to 1GB): OS: Windows: XP, Vista, 7 (32 or 64bit) MacOS: 10.5.8 or later Linux: Ubuntu8.04 or later; glibc2.7 or greater Java: JDK 5 or 6 Eclipse: 3.5 or greater with JDT plugin Android Development Tools SDK Packages for Android Releases
Install Java Development Kit Java Runtime should be installed first, latest version SE Standard Edition 32 Bit or 64/bit for your OS 7u7 is latest jdk-7u7-windows-x64.exe for 64-bit Windows http://www.oracle.com/technetwork/java/javase/downloads/jdk7u7-downloads-1836413.html
Install Android SDK Android SDK http://developer.android.com/sdk/index.html Installer_r20.0.3-windows.exe for Windows
Add Android SDK Packages V2.2 (v4 future)
Android Versions 1.01 1.12 1.53 1.64 Version Name Date Android Bender Cupcake Donut September 23, 2008 February 9, 2009 April 30, 2009 September 15, 2009 2.0 5-6 2.17 2.28 2.39-10 3.011 4.014 4.1 Éclair Eclair FroYo Gingerbread Honeycomb Ice Cream Sandwich Jelly Bean October 26, 2009 January 12, 2010 May 20, 2010 December 6, 2010 February 22, 2011 October 19, 2011 July 9, 2012
Android Architecture
Create an Android v2.2 AVD Android Virtual Device for v2.2
Install Eclipse for Java Eclipse for 64-bit Windows: eclipse-java-indigo-sr2-win32-x86_64.zip http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr2 Eclipse IDE is standard Android Development Environment Requires ADT plug-in Just copy directory structure from Zip file to a directory (C:\eclipse in my case)
Install ADT Plug-in to Eclipse The ADT plug-in information can be found at: http://developer.android.com/tools/sdk/eclipse-adt.html#downloading In Eclipse, In Eclipse, Select Help>Install New Software Add this repository https://dl-ssl.google.com/android/eclipse/ Use ADT Plugin for the name
Android ADT Plug-ins
Version Adoption *based on Google Play Access over 14 day periods
DalvikVM Android Framework WebKitBrowser 2d Graphics Library, 3D w/opengl SQLite MPEG4, MP3, PNG, JPEG, etc GSM Telephony, Bluetooth, WiFi Camera, GPS, Compass, Accelerometer Scanner, MSR, etc.
The Android Manifest XML file for each Application Java Package Name for the Application Components of the Application (Activities, Services, Broadcast Receivers, Content Providers) Intents Handled by Components Processes for Components Permissions Required to Install and Use Permissions Required to Access Minimum Android API Level Libraries Linked to Application
Activity An activity is a single, focused thing that the user can do Each app screen usually a separate activity Create by extending the Activity class Normally doesn t exit
Example Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="bruce.tipcalc" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".tipcalculatoractivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest>
Layout XML <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/label" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="type here:"/> <EditText android:id="@+id/entry" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:layout_below="@id/label"/> <Button android:id="@+id/ok" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/entry" android:layout_alignparentright="true" android:layout_marginleft="10dip" android:text="ok" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toleftof="@id/ok" android:layout_aligntop="@id/ok" android:text="cancel" /> </RelativeLayout>
Eclipse Android Live Demo
THANK YOU