introduction to android

26
Gyuri Grell http://gyurigrell.com August 19, 2009

Upload: gyuri-grell

Post on 15-Nov-2014

16 views

Category:

Documents


0 download

DESCRIPTION

This presentation is a quick introduction to the basic knowledge needed to start developing for the Android mobile platform. This general overview shows the system architecture, SDK and tools, along with some basic need-to-know classes like Activities, Intents, Views, Layouts, Services and ContentProviders.

TRANSCRIPT

Page 1: Introduction to Android

Gyuri Grell

http://gyurigrell.com

August 19, 2009

Page 2: Introduction to Android

System Architecture

Page 3: Introduction to Android

Upcoming Hardware

Source: http://www.googleandblog.com

Page 4: Introduction to Android

Open Source Project

http://source.android.com Apache 2.0 and GPL v2 Git repository

Page 5: Introduction to Android

Developing Android Apps

Android SDK Eclipse plugin

Page 6: Introduction to Android

Android SDK

Android emulator command line tools documentation example applications

Page 7: Introduction to Android

Command Line Tools

aapt - Android asset packaging tool adb - Android debug bridge aidl - Android IDL compiler emulator - Android emulator

Page 8: Introduction to Android

Android Emulator

Page 9: Introduction to Android

Emulator Limitations No support for:

placing or receiving actual phone callscamera/video capture (input)audio inputdetermining connected statedetermining battery charge levelBluetooth

OpenGL ES emulated in software (very slow) Not representative of actual hardware speed

Page 10: Introduction to Android

Eclipse plugin

Page 11: Introduction to Android

Application Building Blocks

AndroidManifest.xml Activities Views Layouts Intents & IntentReceivers Services Notifications ContentProviders

Page 12: Introduction to Android

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 13: Introduction to Android

Activity

an activity is usually a single screen in your application

however, activities can also beFacelessIn a floating windowReturn a value

one activity is designated as the entry point for your application

Page 14: Introduction to Android

android.app.Activityimport android.app.Activity;public class MyActivity extends Activity{ public void onCreate(Bundle savedValues) { super.onCreate(savedValues); setContentView(R.layout.main); }}

Page 15: Introduction to Android

Views

an object that knows how to draw itself on the screen

examples: android.widget.ListViewandroid.widget.DatePickerandroid.widget.Buttonandroid.widget.ImageView

Page 16: Introduction to Android

Layouts<?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 17: Introduction to Android

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”

Your application can provide system intents to override built-in functionality

Page 18: Introduction to Android

android.content.Intent

VIEW_ACTION EDIT_ACTION PICK_ACTION WEB_SEARCH_ACTION SYNC_ACTION ...

Page 19: Introduction to Android

IntentReceiver

Set and respond to notifications or status changes

Can wake up your app

Page 20: Introduction to Android

Service

Faceless task that runs in the background

Page 21: Introduction to Android

ContentProvider

Enable applications to share data

Page 22: Introduction to Android

Distributing Android Apps

Android Market self-publish on your own web site use a 3rd party application store

Page 23: Introduction to Android

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 24: Introduction to Android

Self Publish

upload APK to your own web serverhttp://example.com/download/example-2008-10-

26.apk

use correct MIME typeapplication/vnd.android.package-archive

Page 25: Introduction to Android

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://source.android.com http://www.anddev.org

Page 26: Introduction to Android

Thank You!

Sources for presentationIntroduction to Android by Sean SullivanAn introduction to Android by Jason Chen

For further information visit my blog posthttp://bit.ly/android-intro