introduction to android - mobile portland
DESCRIPTION
Mobile Portland - October 27, 2008 - www.mobileportland.comTRANSCRIPT
![Page 1: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/1.jpg)
Introduction to Android
Sean SullivanOctober 27, 2008
![Page 2: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/2.jpg)
![Page 3: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/3.jpg)
![Page 4: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/4.jpg)
![Page 5: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/5.jpg)
What is Android?
“Android is a software stack for mobile devices that includes an operating system, middleware and key applications”
source: Google
![Page 6: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/6.jpg)
Android
• G1 and the Android Market
• Android platform
• Developer tools
• Android programming
![Page 7: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/7.jpg)
Google’s master plan
• make the cloud more accessible
• keep connectivity pervasive
• make the client more powerful
source: Google I/O keynote, May 2008
![Page 8: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/8.jpg)
Google’s master plan
source: Google I/O keynote, May 2008
![Page 9: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/9.jpg)
“We want the next killer application to be written for cell phones”
(Andy Rubin, Google)
source: businessweek.com
![Page 10: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/10.jpg)
Google buys Android
source: businessweek.com
August 2005
![Page 11: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/11.jpg)
Open Handset Alliance
November 2007
![Page 12: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/12.jpg)
Open Handset Alliance
![Page 13: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/13.jpg)
Android SDK
November 2007
![Page 14: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/14.jpg)
T-Mobile G1
September 2008
![Page 15: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/15.jpg)
Retail launch
October 22, 2008
photo credit: Don Park
![Page 16: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/16.jpg)
• Qualcomm MSM7201A, 528 MHz
• ROM 256 MB
• RAM 192 MB
• 4.60 in x 2.16 in x 0.62 in
• 158 grams
• Lithium Ion battery,1150 mAh
G1 technical specs
![Page 17: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/17.jpg)
G1 technical specs
• 3G (HSDPA)
• touch screen, HVGA 320x480
• QWERTY keyboard
• 3.2 megapixel camera
• microSD expansion slot
• GPS, compass, accelerometer
![Page 18: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/18.jpg)
Third party applications
lifeaware.net Maverick Android Locale
![Page 19: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/19.jpg)
Android applications
• multiple applications, running simultaneously
• user may switch between running applications
• background services
• copy and paste
![Page 20: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/20.jpg)
Distributing Android apps
• Android Market
• self-publish on your own web site
• use a 3rd party application store
![Page 21: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/21.jpg)
Android Market
![Page 22: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/22.jpg)
Android Market
• $25 registration fee for developers
• developer receives 70% of each sale
• remaining amount goes to carriers
• Google does not take a percentage
• http://www.android.com/market/
![Page 23: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/23.jpg)
Market got you down?
• self-publish!
• upload APK to your own web server
http://icecondor.com/download/icecondor-2008-10-26.apk
• use correct MIME type
application/vnd.android.package-archive
![Page 24: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/24.jpg)
Data Synchronization
• How do I sync my calendar data?
• How do I sync my contacts?
• Does Google offer anything like MobileMe?
![Page 25: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/25.jpg)
Data Synchronization
“the best way to synchronize these various pieces of information is to let the device do it on its own while you're not looking, so you never have to think about it. Once you've logged into your Google account on an Android-powered phone it automatically synchronizes all your contacts and Gmail information so everything is always available”
source: googlemobile.blogspot.com
![Page 26: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/26.jpg)
System Architecture
![Page 27: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/27.jpg)
Open source project
• http://source.android.com
• Apache 2.0 and GPL v2
• Git repository
![Page 28: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/28.jpg)
Android applications
• are written in the Java language
• run on the Dalvik virtual machine
![Page 29: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/29.jpg)
Dalvik VM
• not a Java VM
• design constraints: slow CPU, little RAM
• will run on OS without swap space
• http://sites.google.com/site/io/dalvik-vm-internals
![Page 30: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/30.jpg)
Application API’s
J2SE
java.util.* java.io.*
java.lang.*etc
UIandroid.widget.*android.view.*
android.graphics.*
Telephony android.telephony.IPhone
SMS android.telephony.gsm.SmsManager
![Page 31: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/31.jpg)
Application API’s
Web android.webkit.WebView
Camera android.hardware.CameraDevice
Local database android.database.*
Maps com.google.android.maps.MapView
Location android.location.LocationManagerMultimedia android.media.MediaPlayer
HTTP org.apache.http.client.*
![Page 32: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/32.jpg)
Demo
http://code.google.com/p/jfireeagle/source/browse/#svn/trunk/jfireeagle-android-app
• Android 1.0
• GPS
• Yahoo Fire Eagle
• OAuth
![Page 33: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/33.jpg)
Getting started
http://code.google.com/android
![Page 34: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/34.jpg)
Development tools
• Android SDK
• Eclipse plugin
![Page 35: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/35.jpg)
Android SDK
• Android emulator
• command line tools
• documentation
• example applications
![Page 36: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/36.jpg)
Command line tools
• aapt - Android asset packaging tool
• adb - Android debug bridge
• aidl - Android IDL compiler
• emulator - Android emulator
![Page 37: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/37.jpg)
Android emulator
![Page 38: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/38.jpg)
Android emulator
![Page 39: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/39.jpg)
Emulator limitations
• No support for placing or receiving actual phone calls
• No support for camera/video capture (input)
• No support for audio input
• No support for determining connected state
• No support for determining battery charge level
• No support for Bluetooth
![Page 40: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/40.jpg)
Eclipse plugin
https://dl-ssl.google.com/android/eclipse/
![Page 41: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/41.jpg)
Android applications
• application package file: myapp.apk
• an application is composed of one or more activities
![Page 42: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/42.jpg)
Activity
• an activity is usually a single screen in your application
• however, activities can also be faceless
• one activity is designated as the entry point for your application
![Page 43: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/43.jpg)
android.app.Activity
import android.app.Activity;
public class MyActivity extends Activity { public void onCreate(Bundle savedValues) { super.onCreate(savedValues); setContentView(R.layout.main); }
}
![Page 44: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/44.jpg)
Application building blocks
• AndroidManifest.xml
• Activities
• Views
• Layouts
• Intents & IntentReceivers
• Services
• Notifications
• ContentProviders
![Page 45: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/45.jpg)
Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.my_domain.app.helloactivity"> <application android:label="@string/app_name"> <activity android:name=".HelloActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest>
AndroidManifest.xml
![Page 46: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/46.jpg)
Implementing yourapplication UI
• Java code
• XML
![Page 47: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/47.jpg)
Android UI: XML
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello World" /></LinearLayout>
![Page 48: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/48.jpg)
Android UI: Views
• an object that knows how to draw itself on the screen
• examples:
• android.widget.ListView
• android.widget.DatePicker
• android.widget.Button
• android.widget.ImageView
![Page 49: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/49.jpg)
Intents
• “an Intent is a simple message object that represents an ‘intention’ to do something”
• “an intent is an abstract description of an operation to be performed”
![Page 50: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/50.jpg)
android.content.Intent
• VIEW_ACTION
• EDIT_ACTION
• PICK_ACTION
• WEB_SEARCH_ACTION
• SYNC_ACTION
• ...
![Page 51: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/51.jpg)
Application Context
• startActivity(Intent)
• getSystemService
• createDatabase
• openDatabase
• deleteDatabase
• ...
android.app.ApplicationContext
![Page 52: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/52.jpg)
Additional topics• Threading
• Security model
• Internationalization
• Power management
• AIDL - Android IDL
• Data synchronization
• WiFi API
• Bluetooth API
![Page 53: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/53.jpg)
What’s Next
• more phones (Motorola, ...)
• multi-touch?
• virtual keyboard
• Bluetooth A2DP
• enterprise features (Exchange support?)
![Page 54: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/54.jpg)
Android resources
• http://code.google.com/android/
• http://android-developers.blogspot.com
• http://code.google.com/p/apps-for-android/
• http://sites.google.com/site/io/
• http://www.openhandsetalliance.com/
• http://source.android.com
![Page 55: Introduction to Android - Mobile Portland](https://reader033.vdocument.in/reader033/viewer/2022061300/54c71bbb4a7959353d8b45c0/html5/thumbnails/55.jpg)
The End