Top Banner
Getting Started with Android Sean Sullivan OSSPAC 17 February 2009
45

Getting Started with Android - OSSPAC 2009

May 06, 2015

Download

Technology

sullis

Getting Started with Android
OSSPAC conference
Singapore
February 17 2009
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Getting Started with Android - OSSPAC 2009

Getting Started with Android

Sean SullivanOSSPAC

17 February 2009

Page 2: Getting Started with Android - OSSPAC 2009

05 February 2009

Singapore Telecommunications Limited (SingTel) and HTC Corporation, a global leader in mobile phone innovation and design, today unveiled the first Android™ powered mobile phone released in Asia - the HTC Dream™

Page 3: Getting Started with Android - OSSPAC 2009
Page 4: Getting Started with Android - OSSPAC 2009
Page 5: Getting Started with Android - OSSPAC 2009
Page 6: Getting Started with Android - OSSPAC 2009

What is Android?

Android is a software stack for mobile devices that includes an operating system, middleware and key applications

source: Google

Page 7: Getting Started with Android - OSSPAC 2009

August 2005

Google acquires Android

November 2007

Open Handset Alliance announcement

Android SDK available

Page 8: Getting Started with Android - OSSPAC 2009

Open Handset Alliance

Page 9: Getting Started with Android - OSSPAC 2009

September 2008

HTC and T-Mobile announce G1

October 2008

Android SDK 1.0

Android Market goes live

G1 available in retail stores in USA

Page 10: Getting Started with Android - OSSPAC 2009

• 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

• WiFi 802.11 b/g

Technical specs

Page 11: Getting Started with Android - OSSPAC 2009

Technical specs• 3G (HSDPA)

• quad band GSM

• touch screen, HVGA 320x480

• QWERTY keyboard

• 3.2 megapixel camera

• microSD expansion slot

• GPS, compass, accelerometer

Page 12: Getting Started with Android - OSSPAC 2009

Third party applications

lifeaware.net Maverick Android Locale

Page 13: Getting Started with Android - OSSPAC 2009

Android applications

• multiple applications, running simultaneously

• user may switch between running applications

• background services

• copy and paste

Page 14: Getting Started with Android - OSSPAC 2009

Distributing Android apps

• Android Market

• self-publish on your own web site

• use a 3rd party application store

Page 15: Getting Started with Android - OSSPAC 2009

Android Market

Page 16: Getting Started with Android - OSSPAC 2009

Android Market

• US$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 17: Getting Started with Android - OSSPAC 2009

Self-publishing

• upload application to your own web serverhttp://icecondor.com/download/icecondor-v20090201.apk

• use correct MIME type

application/vnd.android.package-archive

Page 18: Getting Started with Android - OSSPAC 2009

System Architecture

Page 19: Getting Started with Android - OSSPAC 2009

Open source project

• http://source.android.com

• Apache 2.0 and GPL v2

• Git repository

Page 20: Getting Started with Android - OSSPAC 2009

Android applications

• are written in the Java language

• run on the Dalvik virtual machine

• Android != J2ME

Page 21: Getting Started with Android - OSSPAC 2009

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 22: Getting Started with Android - OSSPAC 2009

Application API’s

Java

java.util.* java.io.*

java.lang.*etc

UIandroid.widget.*android.view.*

android.graphics.*

Telephony android.telephony.*

SMS android.telephony.gsm.SmsManager

Page 23: Getting Started with Android - OSSPAC 2009

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 24: Getting Started with Android - OSSPAC 2009

Getting started

http://developer.android.com

Page 25: Getting Started with Android - OSSPAC 2009

Development tools

• Java SDK

• Android SDK

• Eclipse

• Eclipse plugin

Page 26: Getting Started with Android - OSSPAC 2009

Android SDK

• Android emulator

• command line tools

• documentation

• example applications

Page 27: Getting Started with Android - OSSPAC 2009

Command line tools

• aapt - Android asset packaging tool

• adb - Android debug bridge

• aidl - Android IDL compiler

• emulator - Android emulator

Page 28: Getting Started with Android - OSSPAC 2009

Android emulator

Page 29: Getting Started with Android - OSSPAC 2009

Eclipse plugin

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

Page 30: Getting Started with Android - OSSPAC 2009

Android applications

• application package file: myapp.apk

• an application is composed of one or more activities

Page 31: Getting Started with Android - OSSPAC 2009

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 32: Getting Started with Android - OSSPAC 2009

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 33: Getting Started with Android - OSSPAC 2009

Application building blocks

• AndroidManifest.xml

• Activities

• Views

• Layouts

• Intents & IntentReceivers

• Services

• Notifications

• ContentProviders

Page 34: Getting Started with Android - OSSPAC 2009

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 35: Getting Started with Android - OSSPAC 2009

UI development

• XML

• Java code

Page 36: Getting Started with Android - OSSPAC 2009

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 37: Getting Started with Android - OSSPAC 2009

Android Views

a view is an object that knows how to draw itself on the screen

Page 38: Getting Started with Android - OSSPAC 2009

ListView

Page 39: Getting Started with Android - OSSPAC 2009

DatePicker

Page 40: Getting Started with Android - OSSPAC 2009

MapView

Page 41: Getting Started with Android - OSSPAC 2009

Additional topics

• Threading

• Security model

• Internationalization

• Power management

• Android IDL (AIDL)

• Data synchronization

• WiFi API

• Bluetooth API

Page 42: Getting Started with Android - OSSPAC 2009

What’s next for Android?

• more phones

• virtual keyboard

• Bluetooth A2DP

• multi-touch?

Page 43: Getting Started with Android - OSSPAC 2009

Questions?

Page 44: Getting Started with Android - OSSPAC 2009

Thank you

Page 45: Getting Started with Android - OSSPAC 2009

Android resources

• http://developer.android.com

• 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