Android intro 2010

of 27 /27
Android by Bram Vandeputte Friday 15 October 2010

description

 

Transcript of Android intro 2010

Page 1: Android intro 2010

Androidby Bram Vandeputte

Friday 15 October 2010

Page 2: Android intro 2010

Inleiding

• Wat ?

• Verzameling van software-componenten

• Voor mobiele toestellen

• Open Source

• Bevat :

• Besturingssysteem

• Middleware

• Standaard applicaties

Friday 15 October 2010

Page 3: Android intro 2010

Inleiding

• Ontwikkelen

• Java

• Android SDK

• emulator

• tools

• API’s

• Externe API’s : Google API

• Eclipse plug-in

Friday 15 October 2010

Page 4: Android intro 2010

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 15 October 2010

Page 5: Android intro 2010

Architectuur

Friday 15 October 2010

Page 6: Android intro 2010

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 15 October 2010

Page 7: Android intro 2010

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 15 October 2010

Page 8: Android intro 2010

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 15 October 2010

Page 9: Android intro 2010

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 15 October 2010

Page 10: Android intro 2010

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 15 October 2010

Page 11: Android intro 2010

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 15 October 2010

Page 12: Android intro 2010

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 15 October 2010

Page 13: Android intro 2010

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 15 October 2010

Page 14: Android intro 2010

Basics (bis)

• AndroidManifest : omschrijving applicatie

• Layout

• Resources

Friday 15 October 2010

Page 15: Android intro 2010

Component Lifecycles

Friday 15 October 2010

Page 16: Android intro 2010

Activity

Friday 15 October 2010

Page 17: Android intro 2010

Service

Friday 15 October 2010

Page 18: Android intro 2010

Getting Started

• Get :

• android-sdk-<your platform>

• Add Android 2.2 platform

• eclipse + ADT plugin

• Links : http://bit.ly/af8h7z

Friday 15 October 2010

Page 19: Android intro 2010

Hello Android

Friday 15 October 2010

Page 20: Android intro 2010

Hello Android

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

• Init : maak een AVD

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

• emulator

Friday 15 October 2010

Page 21: Android intro 2010

Hello Android

Friday 15 October 2010

Page 22: Android intro 2010

Hello Android

• tools :• debugging (Eclipse)

• adb

• set PATH

• adb shell

• sqlite3 data

• .dump

• LogCat

Friday 15 October 2010

Page 23: Android intro 2010

Notepad tutorial• http://developer.android.com/guide/tutorials/notepad

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

• Exercise 1

• Exercise 2

• optional :

• Exercise 3

• Extra credit (debugging)

• uitbreiding

Friday 15 October 2010

Page 24: Android intro 2010

MyGpsApp

• gps mock data

Friday 15 October 2010

Page 25: Android intro 2010

MyGpsApp

• opbouw

• create textview

• LocationManager & LocationListener

• permissions : AndroidManifest.xml

• update textview

Friday 15 October 2010

Page 27: Android intro 2010

Extra

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

• API demos

• http://www.anddev.org

• sdcard

Friday 15 October 2010