Android ?
Lots of Androids...
-
Etymology (from greek):
- ἀνδρός, andrós (man)
- εἶδος, eîdos (external aspect)
- Male anthropomorphic robot (gynoid for a female robot)
- Commercial name of the methyltestosterone
- Adventure board game
- Brand of clothes
- ...
- But also curiously a Linux-based operating system for mobile devices with embedded useful libraries (SQLite, WebKit, OpenGL...)
Tuxdroid
- But remains an existential question: How has been created and designed Bugdroid (the Android mascot)?
A brief history of Android
Prehistory
- October 2003: the development of a mobile OS is started by the Android Inc., company founded by Andy Rubin (and other people) in Palo Alto (California)
- August 2005: Android Inc is being bought by Google (peraps one of the most profitable acquisition of Google)
- November 2007: presentation of the Open Handset Alliance consortium (Google + members of the industry) and the Android Open Source Project (AOSP), beta version under the Open Source Apache license
- September 2008 : first final version of Android embedded in the HTC Dream phone

Major version releases
- October 2011: Android 4.0 is published (Ice Cream Sandwich)
- October 2013: Android 4.4 (KitKat) is published
- November 2014: Android 5.0 (Lollipop) is published with the new ART system (native compilation of applications)
- October 2015: Android 6.0 (Marshmallow) is published
- August 2016: Android 7.0 (Nougat) is published
- August 2017: Android 8.0 (Oreo) is published
- August 2018: Android 9.0 (Pie) is published
- September 2019: Android 10.0 (Q) is published (but without the name of a dessert/candy)
- September 2020: Android 11 is released
- October 4th 2021: Android 12 is released
- August 15th 2022: Android 13 (Tiramisu) is released

Differences between the versions
- Correction of bugs
- New versions of existing APIs
-
New APIs to support new features
- With sometimes retrocompatibility packages (like androidx) for previous versions
- Support of new hardware features (BLE, NFC...)
- New execution mode: from a VM execution to a native execution mode with ART starting from Android 5.0
- Reducing energy consumption (standby behaviour with Doze, connectivity management, resource use quota...)
- Modifying the UI look'n'feel (themes, notifications, windows, PIP mode...)
-
Redesign of the permission system to prevent some abuses
- Example: With Android 13, posting notifications requires a dangerous permission
Components of the Android OS
Android Framework
The kernel
-
Standard Linux kernel with some modifications and enhancements:
- Energy management with WakeLocks (with integration to the main branch of development of the kernel)
- Interprocess communication system with binders
VM & ART

-
Two modes of execution of Android applications:
-
Virtual Machine Dalvik (up to Android 4.4) :
- Conversion from Java bytecode to Dalvik bytecode: .class → .dex
- Dalvik uses a VM with registers with a large set of intructions
- A Just-In-Time (JIT) compiler has been introduced with Android 2.2
-
Android RunTime, ART (from Android 5.0)
- DEX bytecode is compiled to native code when the app is installed (dex2oat)
-
Virtual Machine Dalvik (up to Android 4.4) :
Libraries
-
Libraries implementing the API (compatible with JDK 7):
- Sources in C(++) and Java
- Elements for the communication between apps, access to the sensors (GPS, {accelero,magneto,baro,thermo...}meter and to the network communication (cellular, Wifi, Bluetooth, Near-Field-Contact...)
Mobile operating systems
Active OS
-
Active OS for mobile devices (smartphones, tablets...) (duopoly: >99% of the market share)
- Android (~86% of market share) and derived distributions (LineageOS, eelo...)
-
iOS: only for Apple iPhone (~14% of market share)
- iPadOS: adaped version of iOS for the Apple iPad tablets
-
Other OS (<0,1% of market share)
- Tizen (supported by the Linux Foundation, Samsung and Intel) : connected watches and Samsung TVs (also some phones for the Indian market)
- HarmonyOS: OS developed by Huawei using also a micro-kernel (proposed in a first time on connected TVs for Chinese market)
- KaiOS: OS based on FirefoxOS (using web technologies like HTML5, JavaScript...)
Discontinued OS
-
OS that wre popular:
- Windows Mobile (last version: 10, evolution from Windows Phone and Windows CE)
- BlackBerry OS
-
Discontinued mobile OS:
- Firefox OS (started on 07/2013, partenariats abandonnés)
- MeeGo, Sailfish OS
- Ubuntu Touch (started on 01/2013)
- WebOS (Palm)
- Maemo
- Symbian S60 (used on the first Nokia smartphones like the N95, discontinued in 2013)
-
Feature phone OS (supporting J2ME):
- Bada (Samsung)
- Symbian S40 (Nokia)
OS in works
- Plasma Mobile (based on KDE): usable on the LG Nexus 5
- PostmarketOS (based on the distribution Linux Alpine)
- Google Fuschia: OS based on a micro-kernel (Zirkon) that could succeed to Android
Mobile OS market share
State of duopoly: Android vs. iOS, other OSs are negligeable
- Mexico: Android=95% iOS=5%
- Brazil: Android=93% iOS=7%
- Spain: Android=84% iOS=16%
- Italy: Android=81% iOS=19%
- China: Android=74% iOS=26%
- France: Android=73% iOS=27%
- Germany: Android=69% iOS=31%
- Great-Britain: Android=58% iOS=42%
- Japan: Android=56% iOS=44%
- Australia: Android=54% iOS=16%
- USA: Android=49% iOS=51%
Source: https://www.kantarworldpanel.com/global/smartphone-os-market-share/
Peculiarities of a mobile OS
-
Optimizing energy consumption
- Standby mode for hardware components (CPI, screen, modem...)
- Optimizing the execution of code
- Priorizing the apps with AI (from Android 9.0)
-
Adaptation to the hardware specificities:
- Small screen, various screen resolutions, adjustable screen size (folding screen), multiple screens...
- Tactile interface, driven by the voice, with gestures...
- Sensors: accelerometer, compass, GPS, luxmeter...
- Network communication: Bluetooth, Wi-Fi, cellular...
-
Security:
- confined apps with permissions
- storage encryption
Kind of devices supporting Android
-
Mobile devices
-
Mobile phones
- With a cellular modem (GSM, 3G, 4G, 5G...)
- With a touch screen (sometimes several screen, folding screen...)
-
Tablets
- Tablet-computer hybrid models: docking station with a keyboard, pointer and battery
- Tablet-phone hybrid models (small tablet or large phone?): phablette
- Small laptop computers with keyboard
-
Mobile phones
-
Wearable device
-
Watch, wristband
- Working in autonomy
- Paired with a mobile device using the Bluetooth Low Energy (BLE) protocol
- Glasses
- Smart clothes (with sensors)
-
Watch, wristband
-
Sedentary devices
- Smart TV
- ISP box with multimedia features
-
Home automation and IOT (Internet of Things)
- Sensor
- Beacon
- Effector
- Coordinator
- ...
Approaches for mobile development
-
Native development
- Better performances and using the system API (better access to data and hardware)
- But requires rewriting for each operating system (Android, iOS...)
-
Web development (HTML, CSS, JavaScript)
- Normalized API for HTML5 (but inconsistencies may persist between browsers)
- Privilegied approach for some OS: Firefox OS, Tizen...
-
Multi-OS frameworks for web developement (using a WebView to display web content in a native app):
- Apache Cordova (PhoneGap)
- Rhomobile
-
Using mobile multi-platforms frameworks (allowing to develop for Android, iOS and desktop platforms with a single codebase)
- React Native (Facebook): relies on the JavaScript React framework with a bridge communicating with native UI Android components
- Flutter (Google): allows to develop UIs and interactions with them using the Dart language (object oriented language) and a dedicated API
Android versions
Sortie | Version | Dessert | #API | Market share |
09/2008 | 1.0 | 1 | ||
02/2009 | 1.1 | Petit four | 2 | |
04/2009 | 1.5 | Cupcake | 3 | |
09/2009 | 1.6 | Donut | 4 | |
01/2010 | 2.1 | Eclair | 7 | |
05/2010 | 2.2 | Froyo | 8 | |
12/2010 | 2.3-2.3.2 | Gingerbread1 | 9 | |
02/2011 | 2.3.3-2.3.7 | Gingerbread2 | 10 | 0,3% |
05/2011 | 3.1 | Honeycomb1 | 12 | |
07/2011 | 3.2 | Honeycomb2 | 13 | ϵ |
12/2011 | 4.0 | IceCreamSandwich | 15 | 0,3% |
07/2012 | 4.1 | JellyBean1 | 16 | 1,2% |
11/2012 | 4.2 | JellyBean2 | 17 | 1,5% |
07/2013 | 4.3 | JellyBean3 | 18 | 0,5% |
11/2013 | 4.4 | KitKat | 19 | 6,9% |
11/2014 | 5.0 | Lollipop | 21 | 3,0% |
03/2015 | 5.1 | Lollipop | 22 | 11,5% |
10/2015 | 6.0 | Marshmallow | 23 | 16,9% |
08/2016 | 7.0 | Nougat | 24 | 11,4% |
08/2016 | 7.1 | Nougat2 | 25 | 7,8% |
08/2017 | 8.0 | Oreo | 26 | 12,9% |
11/2017 | 8.1 | Oreo2 | 27 | 15,4% |
08/2018 | 9.0 | Pie | 28 | 10,4% |
09/2019 | 10.0 | Q | ||
09/2020 | 11 | R | ||
09/2021 | 12 | S | ||
08/2022 | 13 | Tiramisu |
Market shares are estimated by Google by studying the access to the Google Play Store (figures of May 2019). Maybe more recent figures can be found in the project creation wizard of Android Studio.
Programming languages for Android
-
Native development in C/C++ with the Native Development Kit (NDK)
- Approach used to port existing software libraries, computation intensive parts of code and/or for which we want to fully manage the memory (rather than relying on a garbage collector)
- One can write in C activities using OpenGL (example in the Android documentation)
- C/C++ native libraries can be called from the Java managed code with Java Native Interface (JNI)
-
Development of applications using the Java API (managed languages)
- Languages of choice : Kotlin and Java (Kotlin is more and more popular)
- Java is supported up to the version 11 for Android 13 (for oldest API levels, desugaring is required and chunks of the standard Java API are embedded into the application APK)
-
Any language that can be compiled to Java bytecode (.class files) and that can access to the Java API may be theoretically employed:
- Groovy, Jython, Scala...
-
C# with the Windows Xamarin IDE
- Compilation of C# code to DEX bytecode
- Embedding Mono native libraries for each architecture
Note: some languages require the to include their standard library inside the generated APK (the APK is larger... but it may not be a problem for modern devices with large mass storage memory)
About Kotlin...
Kotlin support
-
Complete support of the Kotlin language since Android Studio v3
- An automatic conversion tool is proposed to migrate from Java to Kotlin in Android Studio
- Language of choice for new projets on Android
- Relatively fast learning curve for Java programmers
-
⚠ Using Kotlin make the final APK file for the application a little bit more heavier since chunks of Kotlin libraries must be embedded inside
- Not a concern for modern devices with lots of storage
Lighter syntax
-
Lighter syntax (limiting idiomatic code)
-
Two styles of declarations of local elements:
- val a = ... to declare a constant (equivalent to using the keyword final in Java)
- var a = ... to declare a variable
- template strings allowing to embed Kotlin expressions: val a = "Hello $name, your are ${yearNow - birthYear} years old"
- Writing constructors doing assigments to fields is now useless
-
Support or properties
- Calling getters and setters are now useless
- Properties can be used syntaxically like fields (but an underlying getter or setter can be called)
- casting is now useless in some trivial situations when the compiler can infer the type (e.g. when the type is checked in a conditionnal expression)
- Existence of singleton objects in the language
- Each class can have a companion object to replace the concept of static members
- Extension methods can be declared (methods that are resolved statically and that can extend an existing class outside of the class)
-
Two styles of declarations of local elements:
Addressing Java problems
-
Support of default value for parameters: fun myMethod(a: int = 0)
- No more necessary to write several methods/constructors with variable number of parameters
- null safety : a reference cannot be null unless it is explicitely declared with the suffix ?
-
No syntactic difference between primitive types and reified types
- However reified types can be used in the translated bytecode (but it is not a concern of the programmer)
-
Support of the co-routines
- Useful for the async programming (suspend fun)
- Make the cohabitation of code running in different threads (UI thread, network access thread...) more easier (see this page for further information)
Kotlin code example: a calculator
- This example does not use the Android API
- RPN calculator using a binary tree to handle arithmetic expressions
// Code sample from Coursand [http://igm.univ-mlv.fr/~chilowi/], under the Apache 2.0 License package fr.upem.coursand.kotlincalc import java.util.* typealias OperandType = Int // alias pour un type typealias Operator = (OperandType, OperandType) -> OperandType val OPERATORS = mapOf<String, Operator>( "+" to { x, y -> x + y }, "-" to { x, y -> x - y }, "*" to { x, y -> x * y }, "/" to { x, y -> x / y}) sealed class ExprTree { // Propriété abstraite abstract val result: OperandType } data class Operation(val operator: Operator, val right: ExprTree, val left: ExprTree): ExprTree() { override fun toString() = "($left) ${OPERATORS.filter { it.value == operator }.keys.first()} ($right)" // Définition du getter de la propriété abstraite override val result get() = operator(left.result, right.result) } data class Operand(val value: OperandType): ExprTree() { override fun toString() = "$value" override val result get() = value } // Méthode d'extension pour construire un arbre d'expression depuis une liste de String fun List<String>.buildExprTree(): ExprTree { val stack = Stack<ExprTree>() this.forEach { val element = it.trim() // it est le paramètre de la lambda val symbol = OPERATORS[element] val number = element.toIntOrNull() when { symbol != null -> stack.push(Operation(symbol, stack.pop(), stack.pop())) number != null -> stack.push(Operand(number)) else -> throw IllegalArgumentException("Invalid input: $element") } } return if (stack.size == 1) stack[0] else throw IllegalArgumentException("The stack does not contain one element") } fun main(args: Array<String>) { System.`in`.bufferedReader().forEachLine { print( try { // try..catch block is a string expression val tree = it.trim().split(" ").buildExprTree() "$tree = ${tree.result}" } catch (e: IllegalArgumentException) { "Exception encountered: $e" }) } }
Android ecosystem
The AOSP
- Reference implementation (Android Open Source Project : AOSP) developped by Google under the Apache 2.0 license
-
The standard distribution of the AOSP is delivered with some basic apps :
- WebKit HTTP client
- calculator
- calendar
- camera app
- clock app
- galery
- messaging app (SMS/MMS)
- music player
- address book
- dialer app
- sound recorder
- ...
Manufacturers' Android versions
-
Android device manufacturers can maintain their own Android distribution with more or less differences with the AOSP :
- Patched kernel
- New modules to support specific hardware (sometimes closed source modules)
- New apps with more functionalities than the basic apps of the AOSP
-
But manufacturers can add limitations :
- Locked root access
-
Locked bootloader (flashing with third-party kernels is impossible)
- Unlocking bootloader is sometimes possible but the manufacturer ask the user to relinquish the warranty
Distributing Android applications
Several ways to install Android apps :
-
Using the Google play app store
-
Some figures:
- ~3M apps in 2020
- ~30G$ of revenue in 2019
- Note: Apple iOS users spend more on the Apple store, despite being a minority they generate a revenue of ~50G$
- Benefit (for users) : Google is supposed to scan the app submissions for malware (and remove dangerous apps)
-
Drawbacks (for developpers) :
- One-time fee registration on the Play Console is required (25$)
- Google keeps 15% (up to $1M) to 30% of app and in-app purchases (idem for the Apple store)
- Circumventing Google payment system (to avoid the 30% fees) for in-app purchases is forbidden
- Google has a discretionary right to ban a developer for more or less valid reasons
-
Some figures:
-
Using another commercial app store
-
Amazon Appstore
- No registration fee
- Amazon keeps 30% of purchases
- The Amazon store is preinstalled on the Android Amazon devices (Fire tablets, Fire sticks...)
- Opera Mobile Store
- GetJar : veteran created in 2004, also proposing J2ME apps
-
Amazon Appstore
-
Using an open source app store
- F-Droid : free software store
-
Creating his/her own app store
- Creation of an Aptoide repository that can be accessed with the Aptoide app
-
Releasing the APK as a download from a website
- Drawback : no automatic update (the user must check by hand and reinstall herself each new version)
Some useful Android apps
- All the applications that are listed are released under an open source license (therefore their source code can be freely consulted and modified).
- Most of the listed apps can be retrieved using the FDroid Store.
Network
- ConnectBot : SSH client
- K-9 Mail : a complete IMAP/POP client (to manage mailboxes)
- SipDroid, CsipSimple, Linphone: SIP phone clients
Games
- FreeCiv: Civilization clone
- FrozenBubble: arcade game
Security
- Android Privacy Guard: OpenPGP implementation
- Keepassdroid: passwords manager
- Free OTP: one-time authentication tokens generator
Multimedia
- VLC: multimedia player
- Kodi (ex XBMC): multimedia player (initially developed for the XBox console)
Misc
- Termux: terminal with a Linux shell with an APT (Debian-like) package manager
- Barcode Scanner: 2D matrix code reader
- FBReader: ebook reader (supporting Epub and mobi formats)
- OSMAnd: offline GPS navigation software using maps from the OpenStreetMap project
- Alternative clients for the Play Store that do not require Google APIs (do not respect the Google ToS):