SlideShare a Scribd company logo
Modifying and 
Enhancing the Core 
Android OS 
Arnav Gupta 
Student, DTU 
Android Framework Engineer, Cube26
A little about myself . . .
College 
• Undergrad student, Electronics and Electrical 
Engineering, Delhi Technological University. 
• Expecting to graduate in 2016, (if I can survive 
college for another 2 years)
Work – Cube26 
• Joined - March ‘14 
• Android Framework Engineer 
• Working on projects of various clients like 
Micromax, LAVA, Intex 
• Developing and integrating smart gesture 
based interaction methods into Android OS. 
• Smart lockscreens, enhanced camera modes 
for phones like Micromax Canvas A290, A310.
Work – Open Source 
Community 
• Contributor and developer on community 
modded ROMs like CyanogenMod and AOKP 
• Open source development partner with Sony 
Mobile 
• Making latest open source Android stack work 
on Sony Xperia phones. 
• Developing various software-based features 
for these modified versions of Android.
Understanding the Android OS
Enhancing and modifying_the_core_android_os
Applications 
• Everything opened from an 
icon on the launcher is an app 
• Almost every user-facing 
interface in Android is an app 
• Very generic in nature, and 
rarely interdependent. 
• Bundled in the form of .apk 
files, like we can get from the 
Play Store.
Framework : SystemUI 
• Lockscreen, Status bar, 
Notification pane, Navigation 
bar 
• Defines how Toasts, Dialog 
boxes look like 
• Lays out the basic look and 
feel of the UI. 
• Packaged as .apk, but is 
device-dependent, and not 
100% generic.
Framework : Providers & APIs 
• User’s do not interact directly. 
• To be used by 3rd party apps 
• Access to various data, hardware, sensors, media, 
audio, graphics etc of the device. 
• Provides app developers uniform methods to interact 
with lower stacks of the OS. 
• Media, graphics, audio etc implementation could be 
significantly different across different hardware. 
• Provide and regulate access to contents and 
services present on the device.
Dalvik / Android Runtime 
• An implementation much similar to the Java Virtual 
Machine. 
• Dalvik – older runtime. Now being superseded by a 
newer Android Runtime from Android L. 
• Executes bytecode. Dalvik bytecode very much 
similar to java bytecode. 
• All applications, including the Framework, run on the 
Dalvik VM. Each process is a fork of zygote.
Libraries 
• Android contains a set of dynamically linkable 
libraries (.so files, much like .dll of Windows) which 
are required for various purposes. 
• Libraries like libc contain core functions, used by 
almost every process. There are OpenGLES libs for 
graphics, security and cryptography related libs like 
libcrypto, libssl. Almost all hardware related 
subsystems are accessible by Hardware Abstraction 
Layer libs. 
• Apps are provided the features of libraries via the 
APIs of the framework. Native code can link to them 
directly.
Kernel 
• Based on the Linux kernel, with a few differences in 
implementation of memory and power management. 
• CPU, IO, Crypto, Audio, Video etc are all same as 
mainline Linux kernel. 
• A major difference – absence of root rights to human 
users, and read-only mode of /data partition 
• The directory structure is pretty different from usual 
Linux distros, divided into /system, /data, and /cache 
partitions.
Building Android for your Phone
Getting a build machine ready 
• 64-bit Linux or Mac, with minimum 4GB RAM. More 
the horsepower, faster the build. 
• Upwards of 40GB of free space. SSD recommended 
over conventional HDD 
• Sun/Oracle Java 6 JDK for building Android 4.4.4 or 
below. Android L can be built with OpenJDK 7 
https://source.android.com/source/initializing.html
Downloading the source 
• About 9GB of source code for Android Kitkat. 
• Spread across 400+ separate git repositories. 
• Each app is maintained independently. The 
framework is one large repository. All Apache 
licensed. 
• Most library stacks are independently maintained. 
Many derived from original GNU/Linux libraries, and 
modified to suit needs of Android. 
https://source.android.com/source/downloading.html
Building the Android OS 
• The linux kernel, over 150 libraries, 30+ apps, and 
the android runtime and various framework packages 
built and compressed into a ~250MB package. 
• A makefile driven process, with no role of any IDE. 
• Device and platform specific builds ( staying true to 
it's embedded linux roots ) that are not cross-compatible 
with other devices. 
https://source.android.com/source/building-running.html
What can be modified ? And how ?
Modifying Android : Apps 
• Basic apps like Phone, Contacts, Mms, Launcher, 
Browser, Settings, Camera are part of the base OS. 
• Functional additions, visual changes, or improved UX 
in these apps are used as differentiating factor by 
OEM-built Android flavours like TouchWiz, Sense, 
MotoBlur or MIUI. 
• App developers with few months of experience can 
start taking a crack at this.
Modifying Android : Framework 
• Improve UX by rethinking the core components like 
notifications, lockscreen, navigation bar, recents. 
• Refresh the look and feel by redesigning the UI 
components and theme/style elements. 
• Extend the ecosystem by adding your own APIs. Get 
3rd party developers onto your ecosystem. 
• More experiences Android developers with deeper 
understanding of underlying APIs can start off.
Modifying Android : HAL & Libraries 
• Lower level feature addition – often accompanied 
with development of superior hardware technologies. 
• Common examples include HDR mode photography, 
audio equalisers and enhancements, high senstivity 
touchscreens for glove mode. 
• Improving algorithms for accuracy and sensitivity for 
sensors.
Modifying Android : Kernel 
• Interesting low-level implementations like ringing 
Alarm in switched-off phone. 
• Add support for custom hardware like heart rate 
sensor, IR blaster etc. 
• Improve performance, extend battery life – writing 
efficient CPU/GPU governors, schedulers. 
• Typical playground for (Embedded) Linux 
enthusiasts.
A look at Open Source Community 
maintained Custom Android 
distributions : 
AOKP 
CyanogenMod 
ParanoidAndroid
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Cube26 feature preview
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Contribute back to Google's 
Android Open Source Project 
(AOSP)
Source control in Android 
• Android is maintained across 400+ git repositories. 
Besides the platform, the ADT, Android Studio, the 
ARM GCC cross compiler are also part of the 
Android Open Source Project. 
https://android.googlesource.com 
• Code submissions pass through a code review 
server called gerrit. Gerrit is a git code review 
software written by Google to manage projects like 
Android and Chromium. 
https://android-review.googlesource.com
Submitting patches to Google 
• Google tends to take only bugfixes from the 
community. UX/UI features are developed in-house, 
and code is dropped only during major releases. 
(there are exceptions) 
• Patches must be verified by the automatic buildbot, 
and approved by at least one member from the 
Android team. 
• Moderate to advanced knowledge of git and gerrit is 
essential to submit patches. (often involves rebasing 
and manual conflict resolving).
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Compatibility : A tiny caveat
Staying compatible with Android 
• Android can be modified to any extent wanted. 
• Beyond certain constraints, modifications may not 
remain compatible. 
• Compatibility is defined by Google as per the CDD 
(Compatibility Definition Document) 
• Compatibility Test Suite and CTS Verifier - set of 
tests designed to test compatibility. 
• Non-compliance with CDD disqualifies the OS to be 
called as “Android”.
Goals of compatibility 
• Providing uniform and stable environment to 3rd party 
app developers. 
• Level playing field across the whole ecosystem. 
• Reduce fragmentation 
• Quality control of the Android brand. 
• Ease of use and familarity for users.
Why remain compatible ? 
• Encash the brand value of Android 
• Benefit from a rich ecosystem ( 1M+ apps, 50K+ 
developers ) 
• Benefit from using Google's APIs and services. 
• Reduce cost of maintenance of code. 
• Build a unique identity while remainging part of a 
larger family.

More Related Content

What's hot

Android Internals
Android InternalsAndroid Internals
Android Internals
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Karim Yaghmour
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
Karim Yaghmour
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
Opersys inc.
 
Customizing Android's UI
Customizing Android's UICustomizing Android's UI
Customizing Android's UI
Opersys inc.
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
Opersys inc.
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
Opersys inc.
 
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
Opersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
Opersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
Opersys inc.
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
Opersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
Opersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
Opersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
Opersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
Opersys inc.
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Opersys inc.
 

What's hot (19)

Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Customizing Android's UI
Customizing Android's UICustomizing Android's UI
Customizing Android's UI
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
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
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 

Similar to Enhancing and modifying_the_core_android_os

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 ppt
Android pptAndroid ppt
Android Applications
Android ApplicationsAndroid Applications
Android Applications
Nazeer Hussain University
 
Android ppt
Android ppt Android ppt
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
NomanKhan869872
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA
NITIN GUPTA
 
Android technology
Android technology Android technology
Android technology
vikas malviya
 
Android
AndroidAndroid
Android
Tapan Khilar
 
Android App Developement
Android App DevelopementAndroid App Developement
Android App Developement
Aayush Gupta
 
document
documentdocument
document
Joyful Vino
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpoint
JohnLagman3
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Aravindharamanan S
 
Android 130923124440-phpapp01
Android 130923124440-phpapp01Android 130923124440-phpapp01
Android 130923124440-phpapp01
rajesh kumar
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
niteshnarayanlal
 
Chapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt plChapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt pl
ENBAKOMZAWUGA
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
krishnastudent88
 
Android ppt
Android pptAndroid ppt
Android ppt
Hari Krishna
 
Android
AndroidAndroid
Android
Rohith Rg
 
Android OS
Android OSAndroid OS
Android OS
Nitin Ramchandani
 

Similar to Enhancing and modifying_the_core_android_os (20)

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 ppt
Android pptAndroid ppt
Android ppt
 
Android Applications
Android ApplicationsAndroid Applications
Android Applications
 
Android ppt
Android ppt Android ppt
Android ppt
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA
 
Android technology
Android technology Android technology
Android technology
 
Android
AndroidAndroid
Android
 
Android App Developement
Android App DevelopementAndroid App Developement
Android App Developement
 
document
documentdocument
document
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpoint
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android 130923124440-phpapp01
Android 130923124440-phpapp01Android 130923124440-phpapp01
Android 130923124440-phpapp01
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
Chapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt plChapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt pl
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android
AndroidAndroid
Android
 
Android OS
Android OSAndroid OS
Android OS
 

Recently uploaded

Biography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdf
Biography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdfBiography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdf
Biography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdf
amgratefulkhid
 
What is the Meaning of the Word Biscuit?
What is the Meaning of the Word Biscuit?What is the Meaning of the Word Biscuit?
What is the Meaning of the Word Biscuit?
Mona Rathore
 
bangalore Girls call 👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDelivery
bangalore Girls call  👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDeliverybangalore Girls call  👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDelivery
bangalore Girls call 👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDelivery
Jasmine Rawat
 
RMIT degree offer diploma Transcript
RMIT degree offer diploma TranscriptRMIT degree offer diploma Transcript
RMIT degree offer diploma Transcript
sozta
 
Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...
Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...
Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...
dizzycaye
 
Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...
margaretblush
 

Recently uploaded (6)

Biography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdf
Biography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdfBiography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdf
Biography And Tributes of the Late Mrs Stella Atsupui Eddah Amedorme.pdf
 
What is the Meaning of the Word Biscuit?
What is the Meaning of the Word Biscuit?What is the Meaning of the Word Biscuit?
What is the Meaning of the Word Biscuit?
 
bangalore Girls call 👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDelivery
bangalore Girls call  👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDeliverybangalore Girls call  👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDelivery
bangalore Girls call 👀 XXXXXXXXXXX 👀 Cash Payment With Room DeliveryDelivery
 
RMIT degree offer diploma Transcript
RMIT degree offer diploma TranscriptRMIT degree offer diploma Transcript
RMIT degree offer diploma Transcript
 
Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...
Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...
Celebrity Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And ...
 
Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Marol Naka 9910780858 Provide Best And Top Girl Service And No1 in...
 

Enhancing and modifying_the_core_android_os

  • 1. Modifying and Enhancing the Core Android OS Arnav Gupta Student, DTU Android Framework Engineer, Cube26
  • 2. A little about myself . . .
  • 3. College • Undergrad student, Electronics and Electrical Engineering, Delhi Technological University. • Expecting to graduate in 2016, (if I can survive college for another 2 years)
  • 4. Work – Cube26 • Joined - March ‘14 • Android Framework Engineer • Working on projects of various clients like Micromax, LAVA, Intex • Developing and integrating smart gesture based interaction methods into Android OS. • Smart lockscreens, enhanced camera modes for phones like Micromax Canvas A290, A310.
  • 5. Work – Open Source Community • Contributor and developer on community modded ROMs like CyanogenMod and AOKP • Open source development partner with Sony Mobile • Making latest open source Android stack work on Sony Xperia phones. • Developing various software-based features for these modified versions of Android.
  • 8. Applications • Everything opened from an icon on the launcher is an app • Almost every user-facing interface in Android is an app • Very generic in nature, and rarely interdependent. • Bundled in the form of .apk files, like we can get from the Play Store.
  • 9. Framework : SystemUI • Lockscreen, Status bar, Notification pane, Navigation bar • Defines how Toasts, Dialog boxes look like • Lays out the basic look and feel of the UI. • Packaged as .apk, but is device-dependent, and not 100% generic.
  • 10. Framework : Providers & APIs • User’s do not interact directly. • To be used by 3rd party apps • Access to various data, hardware, sensors, media, audio, graphics etc of the device. • Provides app developers uniform methods to interact with lower stacks of the OS. • Media, graphics, audio etc implementation could be significantly different across different hardware. • Provide and regulate access to contents and services present on the device.
  • 11. Dalvik / Android Runtime • An implementation much similar to the Java Virtual Machine. • Dalvik – older runtime. Now being superseded by a newer Android Runtime from Android L. • Executes bytecode. Dalvik bytecode very much similar to java bytecode. • All applications, including the Framework, run on the Dalvik VM. Each process is a fork of zygote.
  • 12. Libraries • Android contains a set of dynamically linkable libraries (.so files, much like .dll of Windows) which are required for various purposes. • Libraries like libc contain core functions, used by almost every process. There are OpenGLES libs for graphics, security and cryptography related libs like libcrypto, libssl. Almost all hardware related subsystems are accessible by Hardware Abstraction Layer libs. • Apps are provided the features of libraries via the APIs of the framework. Native code can link to them directly.
  • 13. Kernel • Based on the Linux kernel, with a few differences in implementation of memory and power management. • CPU, IO, Crypto, Audio, Video etc are all same as mainline Linux kernel. • A major difference – absence of root rights to human users, and read-only mode of /data partition • The directory structure is pretty different from usual Linux distros, divided into /system, /data, and /cache partitions.
  • 14. Building Android for your Phone
  • 15. Getting a build machine ready • 64-bit Linux or Mac, with minimum 4GB RAM. More the horsepower, faster the build. • Upwards of 40GB of free space. SSD recommended over conventional HDD • Sun/Oracle Java 6 JDK for building Android 4.4.4 or below. Android L can be built with OpenJDK 7 https://source.android.com/source/initializing.html
  • 16. Downloading the source • About 9GB of source code for Android Kitkat. • Spread across 400+ separate git repositories. • Each app is maintained independently. The framework is one large repository. All Apache licensed. • Most library stacks are independently maintained. Many derived from original GNU/Linux libraries, and modified to suit needs of Android. https://source.android.com/source/downloading.html
  • 17. Building the Android OS • The linux kernel, over 150 libraries, 30+ apps, and the android runtime and various framework packages built and compressed into a ~250MB package. • A makefile driven process, with no role of any IDE. • Device and platform specific builds ( staying true to it's embedded linux roots ) that are not cross-compatible with other devices. https://source.android.com/source/building-running.html
  • 18. What can be modified ? And how ?
  • 19. Modifying Android : Apps • Basic apps like Phone, Contacts, Mms, Launcher, Browser, Settings, Camera are part of the base OS. • Functional additions, visual changes, or improved UX in these apps are used as differentiating factor by OEM-built Android flavours like TouchWiz, Sense, MotoBlur or MIUI. • App developers with few months of experience can start taking a crack at this.
  • 20. Modifying Android : Framework • Improve UX by rethinking the core components like notifications, lockscreen, navigation bar, recents. • Refresh the look and feel by redesigning the UI components and theme/style elements. • Extend the ecosystem by adding your own APIs. Get 3rd party developers onto your ecosystem. • More experiences Android developers with deeper understanding of underlying APIs can start off.
  • 21. Modifying Android : HAL & Libraries • Lower level feature addition – often accompanied with development of superior hardware technologies. • Common examples include HDR mode photography, audio equalisers and enhancements, high senstivity touchscreens for glove mode. • Improving algorithms for accuracy and sensitivity for sensors.
  • 22. Modifying Android : Kernel • Interesting low-level implementations like ringing Alarm in switched-off phone. • Add support for custom hardware like heart rate sensor, IR blaster etc. • Improve performance, extend battery life – writing efficient CPU/GPU governors, schedulers. • Typical playground for (Embedded) Linux enthusiasts.
  • 23. A look at Open Source Community maintained Custom Android distributions : AOKP CyanogenMod ParanoidAndroid
  • 75. Contribute back to Google's Android Open Source Project (AOSP)
  • 76. Source control in Android • Android is maintained across 400+ git repositories. Besides the platform, the ADT, Android Studio, the ARM GCC cross compiler are also part of the Android Open Source Project. https://android.googlesource.com • Code submissions pass through a code review server called gerrit. Gerrit is a git code review software written by Google to manage projects like Android and Chromium. https://android-review.googlesource.com
  • 77. Submitting patches to Google • Google tends to take only bugfixes from the community. UX/UI features are developed in-house, and code is dropped only during major releases. (there are exceptions) • Patches must be verified by the automatic buildbot, and approved by at least one member from the Android team. • Moderate to advanced knowledge of git and gerrit is essential to submit patches. (often involves rebasing and manual conflict resolving).
  • 80. Compatibility : A tiny caveat
  • 81. Staying compatible with Android • Android can be modified to any extent wanted. • Beyond certain constraints, modifications may not remain compatible. • Compatibility is defined by Google as per the CDD (Compatibility Definition Document) • Compatibility Test Suite and CTS Verifier - set of tests designed to test compatibility. • Non-compliance with CDD disqualifies the OS to be called as “Android”.
  • 82. Goals of compatibility • Providing uniform and stable environment to 3rd party app developers. • Level playing field across the whole ecosystem. • Reduce fragmentation • Quality control of the Android brand. • Ease of use and familarity for users.
  • 83. Why remain compatible ? • Encash the brand value of Android • Benefit from a rich ecosystem ( 1M+ apps, 50K+ developers ) • Benefit from using Google's APIs and services. • Reduce cost of maintenance of code. • Build a unique identity while remainging part of a larger family.