Android presentation 2011

32
Android by Bram Vandeputte Friday 14 October 2011

description

 

Transcript of Android presentation 2011

Page 1: Android presentation 2011

Androidby Bram Vandeputte

Friday 14 October 2011

Page 2: Android presentation 2011

Inleiding

• Wat ?

• Verzameling van software-componenten

• Voor mobiele toestellen

• Open Source

• Bevat :

• Besturingssysteem

• Middleware

• Standaard applicaties (o.a. Market)

Friday 14 October 2011

Page 3: Android presentation 2011

Inleiding

• Ontwikkelen

• Java

• Android SDK

• emulator

• tools

• API’s

• Externe API’s : Google API

• Eclipse plug-in

Friday 14 October 2011

Page 4: Android presentation 2011

Features• Application framework : enables reuse and replacement of

components

• Dalvik virtual machine : optimized for mobile devices

• Integrated browser based on the open source WebKit engine

• Optimized graphics : custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)

• SQLite for structured data storage

• Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)

• hardware dependent : GSM Telephony, Bluetooth, EDGE, 3G, WiFi, Camera, GPS, compass, and accelerometer.

Friday 14 October 2011

Page 5: Android presentation 2011

Architectuur

Friday 14 October 2011

Page 6: Android presentation 2011

Basics : Componenten• App : no single entry point (main)

• Activity : scherm

• bestaat uit Views

• reageert op Events

• Service : geen UI (bvb. music playback)

• Broadcast Receiver : ontvang & reageer

• Content provider : data delen

Friday 14 October 2011

Page 7: Android presentation 2011

Basics

• Componenten activeren :

• Intent : asynchrone berichten

• Om Activity, Service of Broadcast Receiver aan te spreken

• Intent filters

• Content Resolver

• Om Content Provider aan te spreken

Friday 14 October 2011

Page 8: Android presentation 2011

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 14 October 2011

Page 9: Android presentation 2011

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 14 October 2011

Page 10: Android presentation 2011

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 14 October 2011

Page 11: Android presentation 2011

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 14 October 2011

Page 12: Android presentation 2011

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 14 October 2011

Page 13: Android presentation 2011

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 14 October 2011

Page 14: Android presentation 2011

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 14 October 2011

Page 15: Android presentation 2011

Component Lifecycles

Friday 14 October 2011

Page 16: Android presentation 2011

Activity

Friday 14 October 2011

Page 17: Android presentation 2011

Service

Friday 14 October 2011

Page 18: Android presentation 2011

Getting Started

• Get :

• android-sdk-<your platform>

• Add Android 2.3 platform

• eclipse + ADT plugin

• Links : http://bit.ly/mume-android

Friday 14 October 2011

Page 19: Android presentation 2011

Hello Android

Friday 14 October 2011

Page 20: Android presentation 2011

Hello Android

• Init : • Run Android Manager (run tools/android)

• maak een AVD

• emulator :• export PATH=${PATH}:/MY/PATH/TO/THE/android-sdk/tools/

• run emulator

• app :• http://developer.android.com/resources/tutorials/hello-world.html

Friday 14 October 2011

Page 21: Android presentation 2011

Hello Android

Friday 14 October 2011

Page 22: Android presentation 2011

Hello Android

• tools :• debugging (Eclipse)

• adb (under platform-tools)

• set PATH

• adb shell

• sqlite3 data

• .dump

• LogCat

Friday 14 October 2011

Page 23: Android presentation 2011

Extra

• http://developer.android.com/guide

• API demos

• http://www.anddev.org

• sdcard

• versions : 2.3 vs 3.0 vs 4.0

Friday 14 October 2011

Page 24: Android presentation 2011

Friday 14 October 2011

Page 25: Android presentation 2011

Friday 14 October 2011

Page 26: Android presentation 2011

Friday 14 October 2011

Page 27: Android presentation 2011

Now let’s get coding

Friday 14 October 2011

Page 28: Android presentation 2011

Notepad tutorial

• http://bit.ly/android-tutorial

• Exercise 1

• Exercise 2

• optional :

• Exercise 3

• Extra credit (debugging)

• uitbreiding

Friday 14 October 2011

Page 29: Android presentation 2011

MyGpsApp

• gps mock data

Friday 14 October 2011

Page 30: Android presentation 2011

MyGpsApp

• opbouw

• create textview

• LocationManager & LocationListener

• permissions : AndroidManifest.xml

• update textview

Friday 14 October 2011