Introduc)on to Android Mobile Compu)ng MEIC/MERC 2014/15 - - PowerPoint PPT Presentation

introduc on to android
SMART_READER_LITE
LIVE PREVIEW

Introduc)on to Android Mobile Compu)ng MEIC/MERC 2014/15 - - PowerPoint PPT Presentation

Introduc)on to Android Mobile Compu)ng MEIC/MERC 2014/15 Nuno Santos 1. SOME CONTEXT Mobile Compu)ng 2014/15 2 What Is Android? Android delivers


slide-1
SLIDE 1

Introduc)on ¡to ¡Android ¡

Mobile ¡Compu)ng ¡

MEIC/MERC ¡2014/15 ¡ ¡ Nuno ¡Santos ¡

slide-2
SLIDE 2
  • 1. ¡SOME ¡CONTEXT ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 2 ¡

slide-3
SLIDE 3

What ¡Is ¡Android? ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 3 ¡

“Android ¡delivers ¡a ¡complete ¡set ¡of ¡soHware ¡for ¡ mobile ¡devices: ¡an ¡opera)ng ¡system, ¡middleware ¡ and ¡key ¡mobile ¡applica)ons.” ¡

¡

  • ­‑-­‑ ¡h$p://android.com/about/ ¡
slide-4
SLIDE 4

Why ¡Look ¡Into ¡Android? ¡

  • Android ¡is ¡the ¡world’s ¡most ¡popular ¡mobile ¡plaRorm ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 4 ¡

Source: ¡h$p://www.idc.com/prodserv/smartphone-­‑os-­‑market-­‑share.jsp ¡ ¡

slide-5
SLIDE 5

The ¡History ¡of ¡Android ¡

  • 2003 ¡-­‑ ¡Android ¡Inc. ¡founded ¡by ¡Andy ¡Rubin ¡
  • Build ¡”…smarter ¡mobile ¡devices, ¡more ¡aware ¡of ¡its ¡owner's ¡loca)on ¡and ¡preferences" ¡
  • 2005 ¡-­‑ ¡Google ¡acquired ¡Android ¡Inc. ¡
  • 2007 ¡– ¡Crea)on ¡of ¡the ¡Open ¡Handset ¡Alliance ¡
  • A ¡consor)um ¡of ¡companies ¡whose ¡goal ¡is ¡to ¡develop ¡open ¡standards ¡for ¡mobile ¡devices ¡
  • Members ¡include ¡Texas ¡Instruments, ¡Broadcom ¡Corpora)on, ¡Google, ¡HTC, ¡Intel… ¡
  • 2008 ¡– ¡Android ¡1.0 ¡is ¡released ¡
  • 2008 ¡– ¡14 ¡new ¡members ¡joined; ¡to ¡date, ¡more ¡than ¡47 ¡organiza)ons ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 5 ¡

slide-6
SLIDE 6

Android ¡Releases ¡

  • 1.0 ¡-­‑ ¡Released ¡September, ¡2008 ¡
  • 1.1 ¡-­‑ ¡Released ¡February, ¡2009 ¡
  • 1.5 ¡(Cupcake) ¡-­‑ ¡Released ¡April, ¡2009 ¡
  • 1.6 ¡(Donut) ¡-­‑ ¡Released ¡September, ¡2009 ¡
  • 2.0 ¡/ ¡2.1 ¡(Eclair) ¡-­‑ ¡Released ¡October, ¡2009 ¡(2.0) ¡and ¡January, ¡2010 ¡(2.1) ¡
  • 2.2 ¡(Froyo) ¡-­‑ ¡Released ¡May, ¡2010 ¡
  • 2.3 ¡(Gingerbread) ¡-­‑ ¡ ¡Released ¡December, ¡2010 ¡
  • 3.0 ¡(Honeycomb) ¡-­‑ ¡Released ¡February, ¡2011 ¡
  • 4.0 ¡(Ice ¡Cream ¡Sandwich) ¡– ¡Released ¡October, ¡2011 ¡
  • 4.1 ¡(Jelly ¡Bean) ¡– ¡Released ¡June, ¡2012 ¡
  • … ¡
  • 4.4 ¡(Kit ¡Kat) ¡– ¡Released ¡September, ¡2013 ¡
  • 5.0 ¡(Lollipop) ¡– ¡Released ¡October, ¡2014 ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 6 ¡

slide-7
SLIDE 7
  • 2. ¡ANDROID ¡OVERVIEW ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 7 ¡

slide-8
SLIDE 8

Architecture ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 8 ¡

slide-9
SLIDE 9

Noteworthy ¡Features ¡

  • Java-­‑based ¡object-­‑oriented ¡applica)on ¡framework ¡

– Apps ¡on ¡top ¡of ¡Java ¡core ¡libraries ¡running ¡on ¡a ¡Dalvik ¡virtual ¡machine ¡

  • Highly-­‑op)mized ¡Java ¡implementa)on ¡

– Very ¡memory-­‑ ¡and ¡performance-­‑efficient ¡ – Highly ¡tuned ¡to ¡limita)ons ¡of ¡small ¡hardware ¡

¡

  • Based ¡upon ¡a ¡modified ¡version ¡of ¡the ¡Linux ¡kernel ¡
  • Rich ¡development ¡environment ¡

– Device ¡emulator, ¡tools ¡for ¡debugging, ¡profiling, ¡rich ¡IDE ¡integra)on ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 9 ¡

slide-10
SLIDE 10

Security ¡and ¡Permissions ¡

  • Each ¡app ¡deployed ¡with ¡unique ¡user ¡and ¡group ¡ID ¡

– Each ¡applica)on ¡file ¡is ¡private ¡ – Sharing ¡must ¡be ¡done ¡explicitly ¡

  • Applica)ons ¡sandboxed ¡in ¡separate ¡VMs ¡
  • Principle ¡of ¡least ¡privilege ¡

– Applica)ons ¡must ¡declare ¡the ¡permissions ¡they ¡need ¡ – The ¡system ¡prompts ¡the ¡user ¡for ¡consent ¡at ¡install ¡)me ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 10 ¡

slide-11
SLIDE 11
  • 3. ¡ANATOMY ¡OF ¡ANDROID ¡APPS ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 11 ¡

slide-12
SLIDE 12

Component ¡Example ¡

  • Ac<vi<es: ¡are ¡like ¡the ¡pages ¡in ¡a ¡website ¡

– Provide ¡an ¡interface ¡for ¡users ¡to ¡interact ¡with ¡the ¡app ¡and ¡take ¡an ¡ac)on ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 12 ¡

Ac<vity ¡A ¡ Ac<vity ¡B ¡

slide-13
SLIDE 13

Views ¡

  • Views: ¡UI ¡elements, ¡hierarchically ¡organized ¡

– Two ¡types: ¡layouts, ¡and ¡widgets ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 13 ¡

E.g., ¡buqon ¡ E.g., ¡linear ¡layout ¡

slide-14
SLIDE 14

Components ¡

  • There ¡are ¡four ¡different ¡types ¡of ¡applica)on ¡components ¡

– Each ¡type ¡has ¡different ¡purpose ¡and ¡a ¡dis)nct ¡lifecycle ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 14 ¡

E.g., ¡play ¡music ¡in ¡ background ¡ E.g., ¡manage ¡user’s ¡ contact ¡informa)on ¡ E.g., ¡show ¡list ¡of ¡ emails ¡ E.g., ¡take ¡ac)on ¡if ¡ baqery ¡low ¡

slide-15
SLIDE 15

Intents ¡

  • Messages ¡that ¡enable ¡communica)on ¡across ¡components ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 15 ¡

slide-16
SLIDE 16

Applica)on ¡Internals ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Android ¡Applica)on ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 16 ¡

Ac)vity ¡A ¡ Service ¡A ¡ Ac)vity ¡B ¡

Components ¡ Modules ¡

View ¡A ¡ View ¡B ¡ View ¡3 ¡

Views ¡ UI ¡elements ¡(e.g., ¡buqon) ¡

Intent ¡A ¡ Intent ¡C ¡ Intent ¡B ¡ Intent ¡D ¡

Intents ¡ Messages ¡

slide-17
SLIDE 17
  • 4. ¡APPLICATION ¡DEVELOPMENT ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 17 ¡

slide-18
SLIDE 18

Development ¡Tools ¡

  • Android ¡SoHware ¡Development ¡Kit ¡(SDK) ¡

– Tools ¡to ¡create, ¡compile, ¡and ¡package ¡apps ¡ – Device ¡emulator ¡ – Tools ¡to ¡create ¡Android ¡Virtual ¡Devices ¡(AVDs) ¡ – Android ¡Debug ¡Bridge ¡(ADB) ¡tool ¡

  • Android ¡Studio ¡

– Full ¡blown ¡IDE ¡based ¡on ¡IntelliJ ¡ – Create, ¡compile, ¡debug ¡and ¡deploy ¡Android ¡applica)ons ¡ – Create ¡and ¡start ¡AVDs ¡ – Specialized ¡edi)on ¡of ¡resource ¡files ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 18 ¡

slide-19
SLIDE 19

Android ¡Studio ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 19 ¡

slide-20
SLIDE 20

Development ¡Process ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 20 ¡

manifest resources source code .xml images, etc.

aapt tool

.apk

  • 3. Package
  • 1. Edit

.class R.java

java compiler dx tool

.dex

  • 2. Compile

adb tool

  • 4. Deploy
slide-21
SLIDE 21

Manifest ¡

  • AndroidManifest.xml ¡defines ¡the ¡skeleton ¡of ¡an ¡applica)on ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 21 ¡

slide-22
SLIDE 22

Resources ¡

  • Include ¡images ¡and ¡certain ¡XML ¡configura)on ¡files ¡

– e.g., ¡res/layout/acBvity_main.xml ¡

  • A ¡reference ¡to ¡a ¡new ¡resource ¡is ¡automa)cally ¡created ¡in ¡R.java ¡

¡

Mobile ¡Compu)ng ¡2014/15 ¡ 22 ¡

slide-23
SLIDE 23

Source ¡Code ¡

  • Source ¡code ¡implements ¡the ¡app ¡components ¡

– E.g., ¡src/com/example/myfirstapp/MainAcBvity.java ¡

Mobile ¡Compu)ng ¡2014/15 ¡ 23 ¡

slide-24
SLIDE 24

Useful ¡Links ¡

  • Android ¡developers: ¡hqp://developer.android.com ¡

– Training: ¡ ¡hqp://developer.android.com/training/index.html ¡ ¡ – API ¡Guides: ¡ ¡hqp://developer.android.com/guide/components/index.html ¡ ¡ – Reference ¡ ¡hqp://developer.android.com/reference/packages.html ¡

  • Remember, ¡Google ¡is ¡your ¡friend ¡J ¡

¡

Mobile ¡Compu)ng ¡2014/15 ¡ 24 ¡