Customing Android: Looking inside the droids belly Embedded Android - - PowerPoint PPT Presentation

customing android
SMART_READER_LITE
LIVE PREVIEW

Customing Android: Looking inside the droids belly Embedded Android - - PowerPoint PPT Presentation

Customing Android: Looking inside the droids belly Embedded Android Appliances What do I mean by Appliances? appliance / pl ns/ Noun A device designed to perform a specific task, typically a domestic one. Digital Signage


slide-1
SLIDE 1

Customing Android:

Looking inside the droids belly

slide-2
SLIDE 2

Embedded Android Appliances

slide-3
SLIDE 3

What do I mean by Appliances?

slide-4
SLIDE 4

ap·pli·ance /əˈplīəns/ Noun

A device designed to perform a specific task, typically a domestic one.

slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7

Digital Signage Appliances

slide-8
SLIDE 8
slide-9
SLIDE 9

Why Embedded Android ?

slide-10
SLIDE 10

Because...

★ Open Source! ★ Very rich platform & APIs ★ Huge industry & community support ★ Wide variety of devices...

slide-11
SLIDE 11

Customisation

slide-12
SLIDE 12

3 Levels

slide-13
SLIDE 13

Levels

  • 1. User
  • 2. Root
  • 3. Platform
slide-14
SLIDE 14
  • 1. User Level Customisation

Things you can do… ★ Use the Home Intent

slide-15
SLIDE 15

Home sweet home

slide-16
SLIDE 16

<activity android:name=".MyHomeActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />

<category android:name="android.intent.category.HOME"/> <category android:name="android.intent.category.DEFAULT" />

</intent-filter> </activity>

slide-17
SLIDE 17

mi casa es su casa

slide-18
SLIDE 18
  • 1. User Level Customisation

Things you can do… ★ Use the Home Intent ★ Use "public API" Intents (eg. Wifi config)

slide-19
SLIDE 19

Intent intent = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK); startActivityForResult(intent, 1);

slide-20
SLIDE 20

Oops…\/

slide-21
SLIDE 21

Hang on a sec...

slide-22
SLIDE 22
slide-23
SLIDE 23

What would Kirk do ?

slide-24
SLIDE 24

More Clichés...

slide-25
SLIDE 25

packages/Apps/Settings/src/com/and roid/settings/wifi/WifiSettings.java

slide-26
SLIDE 26

Intent intent = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK); intent.putExtra("only_access_points", true); intent.putExtra(" extra_prefs_show_button_bar ", true); intent.putExtra(" wifi_enable_next_on_connect ", true); intent.putExtra(" extra_prefs_set_next_text ", "Finish"); startActivityForResult(intent, 1);

slide-27
SLIDE 27

Ta-Da!

slide-28
SLIDE 28
  • 2. Root Level Customisation

No soup root for you!

slide-29
SLIDE 29
  • 2. Root Level Customisation

Things you can do… ★ Call Privileged API’s (eg. Reboot Device) ★ Silent OTA app install/updates

slide-30
SLIDE 30

Silent?

slide-31
SLIDE 31

Xposed!

★ Framework for writing modules to... ★ Monkey-patch anything in the Android Java Framework code ★ Modified /system/bin/app_process ★ http://repo.xposed.info

slide-32
SLIDE 32

3 OS-Level Customisation

slide-33
SLIDE 33

A Trilogy in 4 parts

  • 1. User
  • 2. Root
  • 3. OS -> Android Framework
  • 4. OS -> Kernel
slide-34
SLIDE 34
  • 3. OS - Android Customisation

★ Build Android OS yourself

slide-35
SLIDE 35

AOSP and Building Android

★ hundreds of git repos (>400) ★ huge amounts of disk space req'd ★ Ubuntu 12.04 + Oracle JDK ★ >15min on a very fast machine (i7 Quad-core, 8GB, SSDs, hot ccache) ★ and then you need to ‘flash’ img & test on emu/device :-(

slide-36
SLIDE 36
  • 3. OS - Android Customisation

Things you can do… ★ choose which apps to build/ship ★ customise UI (eg. rm Systembar, Battery/Audio-Vol warnings) ★ choose CPU platform (eg. x86 or MIPS instead of ARM) but wait theres more…

slide-37
SLIDE 37
  • 3. OS - Android Customisation

MORE Things you can do… ★ workaround bugs in hardware (eg. bad LCD EDID) ★ control the platform - use your own signing certs

slide-38
SLIDE 38

A tale of 2 bars (ICS)

packages/SystemUI/src/com/android/systemui/statusbar/Statu sBar.java public void start() { … sb = makeStatusBarView(); AND tablet/TabletStatusBar.java public void start() { ... sb.setVisibility(View.GONE);

slide-39
SLIDE 39

JB & KK ?

★ Exercise for the reader… ★ Tip: GREP is your Friend

slide-40
SLIDE 40
  • 4. OS - Kernel

★ device drivers, eg. custom touchscreens, wifi cards, etc ★ specific hardware / optimisation,

  • eg. run on RPi's !
slide-41
SLIDE 41
  • X. Boss Level - Recovery/Bootloaders!

★ CWM - Popular community recovery img ★ Fastboot - open protocol for ‘talking’ to bootloaders over usb (think “adb for bootloaders”)

slide-42
SLIDE 42

Lights, Camera, Action!

slide-43
SLIDE 43

Sensors

★ Camera, Gyro, Accel, Compass ★ Sonar, IR, Lidar, Temp

slide-44
SLIDE 44

Outputs

★ Lights ★ Environment control (temperature)

slide-45
SLIDE 45

Comms

★ USB ★ ADK ★ Bluetooth (LE) ★ Audio jack

slide-46
SLIDE 46

USB

You might want to get rid of this...

slide-47
SLIDE 47

ADK

"I put my thing down, flip it, and reverse it"

  • "Work It" (Missy Elliot)
slide-48
SLIDE 48

Bluetooth LE

★ Fix it! (lots of bugs in 4.3 and early 4.4’s) ★ Advertise it! (API is coming in “L” release) ★ Tone it down! (several lines on logcat output per LE event)

slide-49
SLIDE 49

Audio Jack ?!?!

slide-50
SLIDE 50

Bonus UART!

slide-51
SLIDE 51

But...

Also don’t want this...

slide-52
SLIDE 52

References

THE book! Also..

slide-53
SLIDE 53

Image Credits

digital signage examples-brightsideonews read the src luke" - Coding Horror Blog, Jeff Atwood "android welcome wizard" - geeksquad.co.uk “audio jack dev board" - NXP "build lights - wikipedia" "audio volume warning" - android bug tracker "usb permissions dialog - phidgets" missy elliost cover - wikipedia nexus4-uart - hackaday

slide-54
SLIDE 54

Thank You!

slide-55
SLIDE 55

Questions?

http://manichord.com github.com/maks @mklin https://plus.google.com/+MaksimLin