image/svg+xml $ $ ing$ ing$ ces$ ces$ Res Res ea ea Res->ea ou ou Res->ou r r ea->r ch ch ea->ch r->ces$ r->ch ch->$ ch->ing$ T T T->ea ou->r

Android ?

Lots of Androids...

Méthyltestosterone, source https://en.wikipedia.org/wiki/File:Methyltestosterone.svg

Tuxdroid

Robot Android

A brief history of Android

Prehistory

Here is the HTC Dream phone, the first commercial phone using an Android OS, source : http://fr.wikipedia.org/wiki/Fichier:T-Mobile_G1_launch_event_2.jpg

Major version releases

Android Nougat

Differences between the versions

Components of the Android OS

Android Framework

Android Framework

The kernel

VM & ART

Dalvik, source : http://www.dalvikurbyggd.is/EN/About-Dalvik/

Libraries

Mobile operating systems

Active OS

Discontinued OS

OS in works

Mobile OS market share

State of duopoly: Android vs. iOS, other OSs are negligeable

Source: https://www.kantarworldpanel.com/global/smartphone-os-market-share/

Peculiarities of a mobile OS

Kind of devices supporting Android

Approaches for mobile development

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

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

Lighter syntax

Addressing Java problems

Kotlin code example: a calculator

// 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

Manufacturers' Android versions

Distributing Android applications

Several ways to install Android apps :

Some useful Android apps

Network

Games

Security

Multimedia

Misc