SlideShare a Scribd company logo
Headless Android Strikes Back!
ABS2014
04/29/2014
Gary Bisson
Embedded Software Engineer
ABOUT THE PRESENTER
• Embedded Software Engineer at Adeneo Embedded
(Bellevue, WA)
BSP Adaptation
Driver Development
System Integration
• Linux/Android enthusiast
SESSION OVERVIEW
1. Introduction
2. Headless Architecture
3. Headless Applications
4. Demonstration
5. Conclusion
Introduction
Headless Android Introduction
WHY ARE WE HERE?
• Android without UI?
• Use cases?
• Set the expectations of such system
Warning
Not about Embedded Linux vs. Headless Android...
5
Headless Android Introduction
WHAT'S THE INTEREST?
• Same OS/application across product line
• Standardized development environment
• Android API & tools:
SDK/NDK
ADB/Fastboot
systrace
6
Headless Android Introduction
WHAT'S DIFFERENT NOW?
• Update:
What has changed since first introduced?
Tips & tricks from past experience
• Come to the dark side of Android...
7
Headless Architecture
Headless Android Headless Architecture
ANDROID ARCHITECTURE
9
Headless Android Headless Architecture
CYBORGSTACK SOLUTION
• The full-blown stack without:
SurfaceFlinger
WindowManager
WallpaperService
InputMethodManager
SystemUI
• Some tricks: fake values from SF Client
10
Headless Android Headless Architecture
CYBORGSTACK SOLUTION
• Integration into source tree:
From Cyborgstack's GitHub:
♦ headless branch
Change for generic-eng target
Directly into AOSP internals
11
Headless Android Headless Architecture
GOING FURTHER
Some went further:
• Remove stock apps
Browser
HTMLViewer
...
• Remove unnecessary preloaded-classes
View
Graphics
...
• Remove few other System Services
12
Headless Android Headless Architecture
SOME FIGURES
• Vanilla Gingerbread generic-eng build:
system size: 64MB
Free memory: 122/256MB
• Cyborgstack Headless build:
system size: 64MB
Free memory: 172/256MB
• Enhanced Headless build:
system size: 47M
Free memory: 202/256MB
13
Headless Android Headless Architecture
SUMMARY
As stated by Cyborgstack:
• Very much a proof of concept
• Not easily portable
Change of frameworks, system...
• Good starting point
• Gingerbread now getting old
14
Headless Android Headless Architecture
AOSP INTEGRATION
• ro.config.headless property
• Alongside Jelly Bean 4.1 release
• Hasn't really evolved since though
15
Headless Android Headless Architecture
NEW ARCHITECTURE
• SurfaceControl: tells user the device is Headless
• WallpaperService: not started
• SystemUI: not started
• DisplayManager: returns HeadlessDisplayAdapter
• PhoneWindowManager: skips action to user
• ActivityManager: skips Home app + activity creation
16
Headless Android Headless Architecture
WHAT'S DIFFERENT
Advantages:
• Same tree for both headless and regular builds
• Easy to tweak:
SystemProperties.get("ro.config.headless", "0")
Drawbacks:
• Not as thorough as it could be
• System Server crashes... needs modifications
17
Headless Android Headless Architecture
WHAT I'VE TRIED
Quick fixes:
• Patch SurfaceControl not to throw an exception
• Patch SurfaceFlinger not to start bootanim
• Remove SystemUI + some stock apps
• config.disable_noncore
• config.disable_systemui
18
Headless Android Headless Architecture
GOING FURTHER
Same work needs to be done:
• Remove WindowManager
• Remove other UI-specific app/libraries
• Reduce preload libraries
• ...
19
Headless Android Headless Architecture
SOME FIGURES
• Vanilla KitKat aosp_arm-eng build:
system size: 303MB
Free memory: 284/512MB
• Generic armv7-a-neon mini build:
system size: 128MB
Free memory: 356/512MB
• Generic "Headless" mini build:
system size: 128MB
Free memory: 356/512MB
• Optimized "Headless" mini build:
system size: 124MB
Free memory: 394/512MB
20
Headless Applications
Headless Android Headless Applications
NO ACTIVITY SO WHAT?
• App components:
Service
ContentProvider
BroadcastReceiver
• Android Framework
22
Headless Android Headless Applications
NO ACTIVITY SO WHAT?
Activities
Services
Broadcast
Receivers
Content
Providers
System
Services
23
Headless Android Headless Applications
HOW TO?
• AndroidManifest.xml trick
• am commands
• persistent for System apps only
• BOOT_COMPLETED Intent otherwise
• System Services:
onSensorChanged()
onKeyDown()
Custom System Service!
24
Headless Android Headless Applications
DEBUGGING
• By default, debugging only works for Activity-based
application
• Need to start the application manually with am
• Either attach manually or specify it in code:
android.os.Debug.waitForDebugger()
25
Headless Android Headless Applications
USE CASES
• Barcode scanner
• Home automation remote
Button vs. Touchscreen
LED vs. Display
IP stays the same
26
Demonstration
Headless Android Demonstration
HARDWARE SELECTION
• Android emulators
Gingerbread 2.3.7_r1
Kit Kat 4.4_r1
• Low-end ARM device:
Atmel sam9g20-ek (64M of RAM)
No graphics
28
Conclusion
Headless Android Conclusion
CONCLUSION
• Good intentions
• Industry demand
• Activity limitation
• Source code: https://github.com/gibsson/headless-android
30
Headless Android Conclusion
QUESTIONS?
31
Headless Android Conclusion
REFERENCES
• Karim Yaghmour: Embedded Android
O'Reilly Shop
• Opersys/Cyborgstack: Headless Android
ABS2012 - Headless Android
Opersys Headless Blog Post
• Headless Android Blogspot (Casey Anderson):
Gingerbread Patches
32

More Related Content

What's hot

Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: Introduction
Jollen Chen
 
The abcs of gpu
The abcs of gpuThe abcs of gpu
The abcs of gpu
Liang Yan
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016
Chris Simmonds
 
Android Flash Development
Android Flash DevelopmentAndroid Flash Development
Android Flash DevelopmentStephen Chin
 
Introductory webinar on iRidium
Introductory webinar on iRidiumIntroductory webinar on iRidium
Introductory webinar on iRidium
iRidiumMobile365
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
Nanik Tolaram
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Arnav Gupta
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Cheng-Yi Yu
 
Kubernetes Robotics Edge Cluster System
Kubernetes Robotics Edge Cluster SystemKubernetes Robotics Edge Cluster System
Kubernetes Robotics Edge Cluster System
Tomoya Fujita
 
Android beyond the smartphone
Android beyond the smartphoneAndroid beyond the smartphone
Android beyond the smartphone
Chris Simmonds
 
Sony robotics overview
Sony robotics overviewSony robotics overview
Sony robotics overview
Tomoya Fujita
 
Android
AndroidAndroid
Android
Vibhu Mishra
 
Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIOQuick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIO
Chris Simmonds
 
Android Internal Services
Android Internal ServicesAndroid Internal Services
Android Internal Services
Nanik Tolaram
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
Sam Bowne
 
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
Sam Bowne
 
Customize and control connected devices
Customize and control connected devicesCustomize and control connected devices
Customize and control connected devices
Codemotion
 

What's hot (20)

Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: Introduction
 
The abcs of gpu
The abcs of gpuThe abcs of gpu
The abcs of gpu
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016
 
Android Flash Development
Android Flash DevelopmentAndroid Flash Development
Android Flash Development
 
Introductory webinar on iRidium
Introductory webinar on iRidiumIntroductory webinar on iRidium
Introductory webinar on iRidium
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
 
Kubernetes Robotics Edge Cluster System
Kubernetes Robotics Edge Cluster SystemKubernetes Robotics Edge Cluster System
Kubernetes Robotics Edge Cluster System
 
Android beyond the smartphone
Android beyond the smartphoneAndroid beyond the smartphone
Android beyond the smartphone
 
Sony robotics overview
Sony robotics overviewSony robotics overview
Sony robotics overview
 
Android OS
Android OSAndroid OS
Android OS
 
Android
AndroidAndroid
Android
 
Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIOQuick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIO
 
Android Internal Services
Android Internal ServicesAndroid Internal Services
Android Internal Services
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
 
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
CNIT 128 6. Analyzing Android Applications (Part 3 of 3)
 
Customize and control connected devices
Customize and control connected devicesCustomize and control connected devices
Customize and control connected devices
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Maddy android
Maddy androidMaddy android
Maddy android
 

Viewers also liked

Useful USB Gadgets on Linux
Useful USB Gadgets on LinuxUseful USB Gadgets on Linux
Useful USB Gadgets on Linux
Gary Bisson
 
Leveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolLeveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory Protocol
Gary Bisson
 
Quickboot on i.MX6
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6
Gary Bisson
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
Emertxe Information Technologies Pvt Ltd
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
Emertxe Information Technologies Pvt Ltd
 

Viewers also liked (7)

Useful USB Gadgets on Linux
Useful USB Gadgets on LinuxUseful USB Gadgets on Linux
Useful USB Gadgets on Linux
 
Leveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory ProtocolLeveraging the Android Open Accessory Protocol
Leveraging the Android Open Accessory Protocol
 
Quickboot on i.MX6
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 

Similar to Headless Android Strikes Back!

Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Codemotion Tel Aviv
 
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
BeMyApp
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
Howard Greenberg
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
Opersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
Opersys inc.
 
ABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded SystemsABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded SystemsBenjamin Zores
 
PHP Unconference Continuous Integration
PHP Unconference Continuous IntegrationPHP Unconference Continuous Integration
PHP Unconference Continuous Integration
Nils Hofmeister
 
Android overview
Android overviewAndroid overview
Android overview
Ahmed M. Abed
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VOpersys inc.
 
Java uk road tour - sep 06
Java uk road tour - sep 06Java uk road tour - sep 06
Java uk road tour - sep 06
scoobeesnac
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIOpersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
Opersys inc.
 
Building CI_CD for Mobile Development.pptx
Building CI_CD for Mobile Development.pptxBuilding CI_CD for Mobile Development.pptx
Building CI_CD for Mobile Development.pptx
GurzuInc
 
The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)
Chris Simmonds
 
Evolution of Android Update Principles
Evolution of Android Update PrinciplesEvolution of Android Update Principles
Evolution of Android Update Principles
GlobalLogic Ukraine
 
Serverless java
Serverless   javaServerless   java
Serverless java
Vishwas N
 
Mobile CICD
Mobile CICD Mobile CICD
Mobile CICD
Gurzu Inc
 
Lick my Lollipop
Lick my LollipopLick my Lollipop
Lick my Lollipop
Tamara Momčilović
 
Pertemuan 3 pm
Pertemuan 3   pmPertemuan 3   pm
Pertemuan 3 pm
obanganggara
 

Similar to Headless Android Strikes Back! (20)

Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
Developing for Android TV and the Nexus player - Mihai Risca & Alexander Wegg...
 
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
ABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded SystemsABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded Systems
 
PHP Unconference Continuous Integration
PHP Unconference Continuous IntegrationPHP Unconference Continuous Integration
PHP Unconference Continuous Integration
 
Android overview
Android overviewAndroid overview
Android overview
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon V
 
Java uk road tour - sep 06
Java uk road tour - sep 06Java uk road tour - sep 06
Java uk road tour - sep 06
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VI
 
Presentation1
Presentation1Presentation1
Presentation1
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Building CI_CD for Mobile Development.pptx
Building CI_CD for Mobile Development.pptxBuilding CI_CD for Mobile Development.pptx
Building CI_CD for Mobile Development.pptx
 
The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)
 
Evolution of Android Update Principles
Evolution of Android Update PrinciplesEvolution of Android Update Principles
Evolution of Android Update Principles
 
Serverless java
Serverless   javaServerless   java
Serverless java
 
Mobile CICD
Mobile CICD Mobile CICD
Mobile CICD
 
Lick my Lollipop
Lick my LollipopLick my Lollipop
Lick my Lollipop
 
Pertemuan 3 pm
Pertemuan 3   pmPertemuan 3   pm
Pertemuan 3 pm
 

Recently uploaded

New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
bhadouriyakaku
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
obonagu
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
skuxot
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 

Recently uploaded (20)

New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 

Headless Android Strikes Back!

  • 1. Headless Android Strikes Back! ABS2014 04/29/2014 Gary Bisson Embedded Software Engineer
  • 2. ABOUT THE PRESENTER • Embedded Software Engineer at Adeneo Embedded (Bellevue, WA) BSP Adaptation Driver Development System Integration • Linux/Android enthusiast
  • 3. SESSION OVERVIEW 1. Introduction 2. Headless Architecture 3. Headless Applications 4. Demonstration 5. Conclusion
  • 5. Headless Android Introduction WHY ARE WE HERE? • Android without UI? • Use cases? • Set the expectations of such system Warning Not about Embedded Linux vs. Headless Android... 5
  • 6. Headless Android Introduction WHAT'S THE INTEREST? • Same OS/application across product line • Standardized development environment • Android API & tools: SDK/NDK ADB/Fastboot systrace 6
  • 7. Headless Android Introduction WHAT'S DIFFERENT NOW? • Update: What has changed since first introduced? Tips & tricks from past experience • Come to the dark side of Android... 7
  • 9. Headless Android Headless Architecture ANDROID ARCHITECTURE 9
  • 10. Headless Android Headless Architecture CYBORGSTACK SOLUTION • The full-blown stack without: SurfaceFlinger WindowManager WallpaperService InputMethodManager SystemUI • Some tricks: fake values from SF Client 10
  • 11. Headless Android Headless Architecture CYBORGSTACK SOLUTION • Integration into source tree: From Cyborgstack's GitHub: ♦ headless branch Change for generic-eng target Directly into AOSP internals 11
  • 12. Headless Android Headless Architecture GOING FURTHER Some went further: • Remove stock apps Browser HTMLViewer ... • Remove unnecessary preloaded-classes View Graphics ... • Remove few other System Services 12
  • 13. Headless Android Headless Architecture SOME FIGURES • Vanilla Gingerbread generic-eng build: system size: 64MB Free memory: 122/256MB • Cyborgstack Headless build: system size: 64MB Free memory: 172/256MB • Enhanced Headless build: system size: 47M Free memory: 202/256MB 13
  • 14. Headless Android Headless Architecture SUMMARY As stated by Cyborgstack: • Very much a proof of concept • Not easily portable Change of frameworks, system... • Good starting point • Gingerbread now getting old 14
  • 15. Headless Android Headless Architecture AOSP INTEGRATION • ro.config.headless property • Alongside Jelly Bean 4.1 release • Hasn't really evolved since though 15
  • 16. Headless Android Headless Architecture NEW ARCHITECTURE • SurfaceControl: tells user the device is Headless • WallpaperService: not started • SystemUI: not started • DisplayManager: returns HeadlessDisplayAdapter • PhoneWindowManager: skips action to user • ActivityManager: skips Home app + activity creation 16
  • 17. Headless Android Headless Architecture WHAT'S DIFFERENT Advantages: • Same tree for both headless and regular builds • Easy to tweak: SystemProperties.get("ro.config.headless", "0") Drawbacks: • Not as thorough as it could be • System Server crashes... needs modifications 17
  • 18. Headless Android Headless Architecture WHAT I'VE TRIED Quick fixes: • Patch SurfaceControl not to throw an exception • Patch SurfaceFlinger not to start bootanim • Remove SystemUI + some stock apps • config.disable_noncore • config.disable_systemui 18
  • 19. Headless Android Headless Architecture GOING FURTHER Same work needs to be done: • Remove WindowManager • Remove other UI-specific app/libraries • Reduce preload libraries • ... 19
  • 20. Headless Android Headless Architecture SOME FIGURES • Vanilla KitKat aosp_arm-eng build: system size: 303MB Free memory: 284/512MB • Generic armv7-a-neon mini build: system size: 128MB Free memory: 356/512MB • Generic "Headless" mini build: system size: 128MB Free memory: 356/512MB • Optimized "Headless" mini build: system size: 124MB Free memory: 394/512MB 20
  • 22. Headless Android Headless Applications NO ACTIVITY SO WHAT? • App components: Service ContentProvider BroadcastReceiver • Android Framework 22
  • 23. Headless Android Headless Applications NO ACTIVITY SO WHAT? Activities Services Broadcast Receivers Content Providers System Services 23
  • 24. Headless Android Headless Applications HOW TO? • AndroidManifest.xml trick • am commands • persistent for System apps only • BOOT_COMPLETED Intent otherwise • System Services: onSensorChanged() onKeyDown() Custom System Service! 24
  • 25. Headless Android Headless Applications DEBUGGING • By default, debugging only works for Activity-based application • Need to start the application manually with am • Either attach manually or specify it in code: android.os.Debug.waitForDebugger() 25
  • 26. Headless Android Headless Applications USE CASES • Barcode scanner • Home automation remote Button vs. Touchscreen LED vs. Display IP stays the same 26
  • 28. Headless Android Demonstration HARDWARE SELECTION • Android emulators Gingerbread 2.3.7_r1 Kit Kat 4.4_r1 • Low-end ARM device: Atmel sam9g20-ek (64M of RAM) No graphics 28
  • 30. Headless Android Conclusion CONCLUSION • Good intentions • Industry demand • Activity limitation • Source code: https://github.com/gibsson/headless-android 30
  • 32. Headless Android Conclusion REFERENCES • Karim Yaghmour: Embedded Android O'Reilly Shop • Opersys/Cyborgstack: Headless Android ABS2012 - Headless Android Opersys Headless Blog Post • Headless Android Blogspot (Casey Anderson): Gingerbread Patches 32