Embedded Android

Post on 19-May-2015

682 views 8 download

Tags:

description

Embedded Android Talk @ Mobile Tec Con 2013 #mtc13

Transcript of Embedded Android

Dominik Helleberg | inovex GmbH

Embedded Android

Dominik Helleberg

Mobile Development

Android

Ingress Level 7

http://dominik-helleberg.de/+

Embedded Android?

http://developer.android.com/design/index.html

https://twitter.com/Arubin/status/27808662429

Why?

http://commons.wikimedia.org/wiki/File:Helvar_Touchscreen_924.jpg

http://ajaishukla.blogspot.de/2009/03/visit-to-ins-shivalik-indias-newest.html

http://commons.wikimedia.org/wiki/File:Rh%C3%A4tische_Bahn_kaartlezer.JPG

Apps

Java

Kernel

Libs HAL Init

Framework / API

System Services

Dalvik / Runtime / Zygote

Tooling

Libraries

User Interface

Developers

Open Source

Hardware Support

Technology Architecture

http://e.ubmelectronics.com/2013EmbeddedStudy/index.html

http://e.ubmelectronics.com/2013EmbeddedStudy/index.html

Stock Apps

Framework / API

User Apps

Java System Services

Dalvik / Runtime / Zygote

Kernel

Libs HAL Init

Stock Apps

Framework / API

User Apps

Java System Services

Dalvik / Runtime / Zygote

Kernel

Libs Init

https://android.googlesource.com/ HAL

Architecture by example - GPS Stock Apps

Framework / API

User Apps

Java System Services

Dalvik / Runtime / Zygote

Kernel

Libs HAL Init

Architecture by example - GPS Stock Apps User Apps

locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);

locationManager.requestLocationUpdates(

LocationManager.GPS_PROVIDER, 0, 0, locationListener);

frameworks/base/location/java/android/location/LocationManager.java

Architecture by example - GPS

Framework / API System Services

try { mService.requestLocationUpdates(request,

transport, intent, packageName); } catch (RemoteException e) { Log.e(TAG, "RemoteException", e); }

frameworks/base/location/java/android/location/LocationManager.java

private final ILocationManager mService;

Architecture by example - GPS

Framework / API System Services

frameworks/base/location/java/android/location/ILocationManager.aidl

Architecture by example - GPS

Framework / API System Services

void requestLocationUpdates( in LocationRequest request, in ILocationListener listener, in PendingIntent intent, String packageName);

frameworks/base/services/java/com/android/server/LocationManagerService.java

LocationProviderInterface provider =

mProvidersByName.get(name);...provider.setRequest(providerRequest,

worksource);

Architecture by example - GPS

Framework / API System Services

frameworks/base/services/java/com/android/server/location/GpsLocationProvider.java

private native boolean native_start();

Architecture by example - GPS

Framework / API System Services

hardware/libhardware/include/hardware/gps.h

/** Represents the standard GPS interface. */typedef struct { int (*init)( GpsCallbacks* callbacks );

/** Starts navigating. */ int (*start)( void );...

Architecture by example - GPS

Libs HAL Init

development/tools/emulator/system/gps/gps_qemu.c

device/samsung/manta/gps/gps.exynos5.so

Architecture by example - GPS

Libs HAL Init

Apps

Java

Kernel

Libs HAL Init

Framework / API

System Services

Dalvik / Runtime / Zygote

§  Freescale BSP

§  7 GB Source

§  Compile Time ~ 45 minutes

§  „Deployment Time“ ~ 5-10 minutes

§  Dependencies ususally fail at runtime

§  You can change everything... Maybe you shouldn‘t ;)

§  Custom WiFi

§  Custom Recovery

§  New APIs for eINK Display

§  Custom USB and Storage

§  System updates

§  Boot time optimization

§  Battery Life Management

§  Custom WiFi

§  Custom Recovery

§  New APIs for eINK Display

§  Custom USB and Storage

§  System updates

§  Boot time optimization

§  Battery Life Management

New APIs for eINK Display

§  300 – 900 ms refresh

§  Update Modes to reduce ghosting

http://commons.wikimedia.org/wiki/File:EInk_Refresh.gif http://commons.wikimedia.org/wiki/File:EInk_simplified.png

Custom USB and Storage

Internal SD-Card

Ext. SD-Card

USB

invalidate()  externalStorage()  

TolinoApp Auth | Shop | Cloud-Storage | Settings | WiFi Auth | Local Storage

Java

Kernel

Libs HAL Init

Framework / API

System Services

Dalvik / Runtime / Zygote

bootloader

kernel

init

service manager

zygote

daemons

boot animiation

System Server

Package Manager

Activity Manager

Power Manager

...

launcher

bootloader

kernel

init

service manager

zygote

daemons

boot animiation

System Server

Package Manager

Activity Manager

Power Manager

...

launcher

/sys/devices/system/cpu/cpuX/cpufreq/stats/time_in_state      160000  632455  400000  781  800000  8825      deepSleepTime  =    

 SystemClock.elapsedRealtime()  -­‐  (Σ  (all  cpu_states));  

deepSleepTime  =      SystemClock.elapsedRealtime()  -­‐    SystemClock.uptimeMillis();  

$  adb  shell  dumpsys  batteryinfo      ....  Statistics  since  last  charge:      System  starts:  0,  currently  on  battery:  false      Time  on  battery:  4d  0h  38m  8s  373ms  (5,3%)  realtime,  5m  55s  182ms  (0,0%)  uptime      Total  run  time:  75d  13h  54m  39s  222ms  realtime,  5h  16m  0s  646ms  uptime,        Screen  on:  5m  46s  126ms  (0,1%),  Input  events:  0,  Active  phone  call:  0ms  (0,0%)      Screen  brightnesses:  dark  8s  614ms  (2,5%),  medium  5m  37s  512ms  (97,5%)      Kernel  Wake  lock  "PowerManagerService":  5s  613ms    (25  times)  realtime      Kernel  Wake  lock  "alarm":  1s  676ms    (9  times)  realtime      Kernel  Wake  lock  "android_usb":  2s  222ms    (1  times)  realtime      Kernel  Wake  lock  "power-­‐supply":  13ms    (1  times)  realtime      Kernel  Wake  lock  "KeyEvents":  93ms    (449  times)  realtime      Kernel  Wake  lock  "main":  5m  46s  194ms    (1  times)  realtime      Total  received:  0B,  Total  sent:  0B      Total  full  wakelock  time:  0ms  ,  Total  partial  waklock  time:  5s  576ms        Signal  levels:  No  activity      Signal  scanning  time:  0ms        Radio  types:  No  activity      Radio  data  uptime  when  unplugged:  0  ms      Wifi  on:  0ms  (0,0%),  Wifi  running:  0ms  (0,0%),  Bluetooth  on:  0ms  (0,0%)    

$  adb  shell  bugreport  >  bugreport.txt    $  java  -­‐jar  chkbugreport-­‐0.4-­‐185.jar  bugreport.txt    

https://github.com/sonyxperiadev/ChkBugReport

http://beagleboard.org/Products/BeagleBone%20Black

http://www.oreilly.de/catalog/9781449308292/index.html

Credits http://www.ouya.tv/about/ https://mediacenter.motorola.com/Image-Gallery/MOTOACTV-Golf-Edition-8c1.aspx http://www.tolino.de https://www.honeywellaidc.com/en-US/resources/image-library/Pages/default.aspx?Category=7800&keywords=7800&title=7800&description=7800 https://android-build.linaro.org/ http://source.android.com/source/building.html http://nvidianews.nvidia.com/Releases/NVIDIA-Untethers-Gaming-With-Project-SHIELD-8ee.aspx http://www.android-user.de/Apps/Auerswald-Comfortel-3500-Das-IP-Telefon-mit-Android-2.3-im-Test

DANKE!