SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
Les nouveautés
d’Android Nougat
Paris Android User Group
Extrait du meetup septembre
Edouard Marquez
Développeur Android Freelance
2
@g123k
+EdouardMarquez
www.edouard-marquez.me
Android TV
Edouard Marquez
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Qu’est-ce que le picture in picture (PIP) ?
4
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Supporter le picture in picture (Android Manifest)
5
<activity
android:name=".MyActivity"

android:resizeableActivity="true"

android:supportsPictureInPicture="true"

android:configChanges="screenSize|smallestScreenSize|
screenLayout|orientation" />
Mettre le launchMode en singleTask est recommandé
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Supporter le picture in picture (bouton)
6
if (supportsPIP(context)) {
adapter.add(
new PlaybackControlsRow.PictureInPictureAction(context));
}
boolean supportsPIP(Context context) {
return BuildCompat.isAtLeastN() && 

context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_PICTURE_IN_PICTURE);
}
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Supporter le picture in picture (activer le mode)
7
public void onActionClicked(Action action) {
if (action.getId() == R.id.lb_control_picture_in_picture) {
getActivity().enterPictureInPictureMode();

return;
}
// ....
}
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Picture in picture
8
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Cacher les composants en mode picture in picture
9
void onPictureInPictureChanged(boolean inPictureInPicture) {
if (inPictureInPicture) {
uiControls.setVisibility(View.INVISIBLE);
} else {
uiControls.setVisibility(View.VISIBLE);
}
}
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Gestion du lifecycle avec le picture in picture
10
public void onPause() {
super.onPause();
if (!inPictureInPicture() && videoView.isPlaying()) {
if (!requestVisibleBehind(true)) {
playPause(false);
} else {
requestVisibleBehind(false);
}
}
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV - Picture in picture : Exemple de code
11
Exemple
de code
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android TV : Enregistrement des chaînes TV
12
Direct Boot
Edouard Marquez
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Etre notifié du démarrage du terminal
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<receiver android:name=".BootBroadcastReceiver"
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
14
Intent relatif au démarrage du terminal
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
L’application doit avoir été
lancée une première fois
avant de recevoir l’Intent
Depuis
Android 3.1
15
Intent relatif au démarrage du terminal
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
3.0 (Honeycomb)
Février 2011
Support du
chiffrement
Full Disk Encryption
(FDE)
4.4 (KitKat)
Novembre 2013
Utilisation de
scrypt
Sécurité renforcée
7.0 (Nougat)
Août 2016
Nouveau type
de chiffrement
File-Based Encryption
(FBE)
5.0 (Lollipop)
Novembre 2014
Diverses
améliorations
Chiffrement sans mot de
passe, support schéma…
16
Android : Evolution du chiffrement
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Mieux
comprendre
le
chiffrement
5.0 (Lollipop)
Novembre 2014
Chiffrement
obligatoire
… puis non
6.0 (Marshmallow)
Septembre 2015
Chiffrement
(vraiment)
obligatoire
17
Android : Evolution du chiffrement
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
— Seuls des mots de passe et PIN
peuvent être utilisés
— La demande au démarrage est
bloquante
Android 3.0 - Android 4.4
— Possibilité d’utiliser des schémas
— Le démarrage sécurisé devient
optionnel
Depuis Android 5.0
18
Android : Evolution du chiffrement
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
— Aucune application tierce n’est
exécutée
— Bloque le lancement du terminal
Démarrage sécurisé
19
Android : Evolution du chiffrement
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Seuls les terminaux
sous Android 7.0
peuvent en bénéficier
Depuis Nougat
Le terminal doit
être chiffré
Données chiffrées
Le chiffrement doit être
“basé sur un fichier”
File-based encryption
20
Comment obtenir Direct Boot ?
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Android Manifest
Ajouter android:directBootAware
uniquement sur les
receivers / services / providers
qui seront accessibles
au démarrage
L’attribut n’apporte rien sur les
Activity, car il faut au préalable
déverrouiller le terminal
Un nouvel Intent est envoyé lors du
“direct boot”
<receiver android:name=".BootBroadcastReceiver"
android:directBootAware="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
21
Implémenter Direct Boot
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Application
“système”
Il est possible de mettre l’attribut sur
le tag application, mais il ne prendra
effet que sur les applications
“système”
<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/Theme.AppCompat.Light"
android:directBootAware="true">
22
Implémenter Direct Boot
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Stockage
disponible
uniquement après
le premier
déverrouillage
Credential Encrypted
(CE) storage
Stockage
disponible avant
et après le premier
déverrouillage
Device Encrypted
(DE) storage
23
Les deux types de stockage
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Utiliser le
stockage DE
Il faut récupérer un Context différent
Deux méthodes permettent de
déplacer facilement les préférences
et bases de données dans leur
globalité
Context context = 

ContextCompat.createDeviceProtectedStorageContext(srcContext);
ContextCompat.isDeviceProtectedStorage(context);
context.moveDatabaseFrom(srcContext, "dbName");
context.moveSharedPreferencesFrom(srcContext, "prefName");
24
Utiliser le stockage DE (accessible avant le déverrouillage)
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Application
“système”
Il est possible d’ajouter un attribut le
tag application afin que seul le
stockage “DE” soit utilisé
<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/Theme.AppCompat.Light"
android:directBootAware="true"
android:defaultToDeviceProtectedStorage="true">
25
Utiliser le stockage DE (accessible avant le déverrouillage)
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Tester Direct Boot
— Paramètres -> Options pour les
développeurs -> Convertir en chiffrement
basé sur un fichier
— adb reboot bootloader

fastboot --wipe-and-use-fbe
Emulation de Direct Boot
— adb shell sm set-emulate-fbe true
— adb shell sm set-emulate-fbe false
26
Tester Direct Boot
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
android.intent.action.BOOT_COMPLETED android.intent.action.USER_PRESENT
27
L’évolution des Intent envoyés : avant Nougat
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
android.intent.action.LOCKED_BOOT_COMPLETED
android.intent.action.USER_PRESENT
puis
android.intent.action.BOOT_COMPLETED
android.intent.action.ACTION_USER_UNLOCKED
28
L’évolution des Intent envoyés : avec Nougat et sans Direct Boot
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
android.intent.action.LOCKED_BOOT_COMPLETED
android.intent.action.BOOT_COMPLETED
android.intent.action.ACTION_USER_UNLOCKED
puis
android.intent.action.USER_PRESENT
29
L’évolution des Intent envoyés : avec Nougat et Direct Boot
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
30
Direct Boot : juste un dernier slide
— Chaque utilisateur possède ses
propres clés
— Une pour le DE, l’autre pour CE
Support multi-utilisateur Exemple de code
UserManagerCompat.
isUserUnlocked(context));
Déverrouillé ?
Mais aussi...
Edouard Marquez
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Raccourci vers les paramètres
32
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Raccourci vers les paramètres
33
Paramètres
Dans l’AndroidManifest, spécifier un
Intent-Filter particulier
Afin d’éviter que d’autres
applications puissent ouvrir cette
Activité, on peut limiter à une
permission
Il n’est pas nécessaire que l’Activité
soit exportée
<activity
android:name=".MyActivity"
android:permission="android.permission.WRITE_SECURE_SETTINGS">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Résolution des langues
34
Default
(en)
fr_BE
en_UK es_ES
de_DE ru_RU
fr_FR
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Résolution des langues (pre-Nougat)
35
fr_FR
existe-il ?
Non juste
fr_BE
fr existe-il ? Non
Valeur par
défaut (en)
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Résolution des langues (depuis Nougat)
36
fr_FR
existe-il ?
Non juste
fr_BE
fr existe-il ?
Non
Existe-t-il
un autre type
de fr ?
Oui
fr_BE
Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand)
PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6
Langues multiples
37
Récupérer les différentes langues
LocaleList.getDefault()
Support de ICU4J
Merci !
Questions ?
@g123k +EdouardMarquez

Contenu connexe

Tendances

Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009JUG Lausanne
 
Créez vos propres plugins qgis
Créez vos propres plugins qgisCréez vos propres plugins qgis
Créez vos propres plugins qgisGildas MFOUMBI
 
Cycle de vie d'activité Android et les composant d'Android
Cycle de vie d'activité Android et les composant d'AndroidCycle de vie d'activité Android et les composant d'Android
Cycle de vie d'activité Android et les composant d'AndroidHoussem Lahiani
 
In01 - Programmation Android - 01 - introduction
In01 - Programmation Android - 01 - introductionIn01 - Programmation Android - 01 - introduction
In01 - Programmation Android - 01 - introductionYann Caron
 
Travailler avec git et eclipse
Travailler avec git et eclipseTravailler avec git et eclipse
Travailler avec git et eclipseFrancois ANDRE
 
Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013jeromevdl
 
Le Guide de Développement pour Android
Le Guide de Développement pour AndroidLe Guide de Développement pour Android
Le Guide de Développement pour AndroidSimon Debaecke
 
GDG Rennes - Bootcamp Initiation Android - Hello World with Events and Intents
GDG Rennes - Bootcamp Initiation Android - Hello World with Events and IntentsGDG Rennes - Bootcamp Initiation Android - Hello World with Events and Intents
GDG Rennes - Bootcamp Initiation Android - Hello World with Events and IntentsHoracio Gonzalez
 
Les vues (views) sous android
Les vues (views) sous androidLes vues (views) sous android
Les vues (views) sous androidHoussem Lahiani
 

Tendances (10)

Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
 
Créez vos propres plugins qgis
Créez vos propres plugins qgisCréez vos propres plugins qgis
Créez vos propres plugins qgis
 
Cycle de vie d'activité Android et les composant d'Android
Cycle de vie d'activité Android et les composant d'AndroidCycle de vie d'activité Android et les composant d'Android
Cycle de vie d'activité Android et les composant d'Android
 
In01 - Programmation Android - 01 - introduction
In01 - Programmation Android - 01 - introductionIn01 - Programmation Android - 01 - introduction
In01 - Programmation Android - 01 - introduction
 
Hello droid
Hello droidHello droid
Hello droid
 
Travailler avec git et eclipse
Travailler avec git et eclipseTravailler avec git et eclipse
Travailler avec git et eclipse
 
Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013
 
Le Guide de Développement pour Android
Le Guide de Développement pour AndroidLe Guide de Développement pour Android
Le Guide de Développement pour Android
 
GDG Rennes - Bootcamp Initiation Android - Hello World with Events and Intents
GDG Rennes - Bootcamp Initiation Android - Hello World with Events and IntentsGDG Rennes - Bootcamp Initiation Android - Hello World with Events and Intents
GDG Rennes - Bootcamp Initiation Android - Hello World with Events and Intents
 
Les vues (views) sous android
Les vues (views) sous androidLes vues (views) sous android
Les vues (views) sous android
 

En vedette

Nougat 7.0 seminar
Nougat 7.0 seminarNougat 7.0 seminar
Nougat 7.0 seminarVen Esh
 
Google Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and moreGoogle Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and moreDevakumar Kp
 
Android N is now Android Nougat
Android N is now Android NougatAndroid N is now Android Nougat
Android N is now Android NougatAppinventiv
 
Android nougat 7.1 | Top Mobile App Development Company
Android nougat 7.1 | Top Mobile App Development CompanyAndroid nougat 7.1 | Top Mobile App Development Company
Android nougat 7.1 | Top Mobile App Development Companytechugo
 
Android nougat
Android nougatAndroid nougat
Android nougatBeApp
 
Android Nougat- Sweet Treat for Users
Android Nougat- Sweet Treat for UsersAndroid Nougat- Sweet Treat for Users
Android Nougat- Sweet Treat for Userstechugo
 
Installation of linux mint 18 sarah
Installation of linux mint 18 sarahInstallation of linux mint 18 sarah
Installation of linux mint 18 sarahAdich3
 
NVIDIA GeForce GTX 1080 Launch
NVIDIA GeForce GTX 1080 LaunchNVIDIA GeForce GTX 1080 Launch
NVIDIA GeForce GTX 1080 LaunchNVIDIA
 
Instalasi Ubuntu 16.10 (Yakkety Yak)
Instalasi Ubuntu 16.10 (Yakkety Yak)Instalasi Ubuntu 16.10 (Yakkety Yak)
Instalasi Ubuntu 16.10 (Yakkety Yak)anafatwa21
 
Kaspersky Internet Security Multi-Device 2015
Kaspersky Internet Security Multi-Device 2015Kaspersky Internet Security Multi-Device 2015
Kaspersky Internet Security Multi-Device 2015Dejan Pogačnik
 
Microsoft Hyper V Server 2008
Microsoft Hyper V Server 2008Microsoft Hyper V Server 2008
Microsoft Hyper V Server 2008vncson
 
NVIDIA GeForce NOW Cloud Game Streaming at GDC
NVIDIA GeForce NOW Cloud Game Streaming at GDCNVIDIA GeForce NOW Cloud Game Streaming at GDC
NVIDIA GeForce NOW Cloud Game Streaming at GDCPhil Eisler
 
2017 acronis cloud spla 서비스소개
2017 acronis cloud spla 서비스소개2017 acronis cloud spla 서비스소개
2017 acronis cloud spla 서비스소개DONG-KYU Kim
 
Whats new v sphere 6
Whats new v sphere 6Whats new v sphere 6
Whats new v sphere 6shixi wang
 
Red Hat Enterprise Linux: Open, hyperconverged infrastructure
Red Hat Enterprise Linux: Open, hyperconverged infrastructureRed Hat Enterprise Linux: Open, hyperconverged infrastructure
Red Hat Enterprise Linux: Open, hyperconverged infrastructureRed_Hat_Storage
 
Honeypot Social Profiling
Honeypot Social ProfilingHoneypot Social Profiling
Honeypot Social ProfilingBryan Conde
 

En vedette (18)

Nougat 7.0 seminar
Nougat 7.0 seminarNougat 7.0 seminar
Nougat 7.0 seminar
 
Google Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and moreGoogle Android 7.0 Nougat History Features and more
Google Android 7.0 Nougat History Features and more
 
Android N is now Android Nougat
Android N is now Android NougatAndroid N is now Android Nougat
Android N is now Android Nougat
 
Android nougat 7.1 | Top Mobile App Development Company
Android nougat 7.1 | Top Mobile App Development CompanyAndroid nougat 7.1 | Top Mobile App Development Company
Android nougat 7.1 | Top Mobile App Development Company
 
Android nougat
Android nougatAndroid nougat
Android nougat
 
Android Nougat- Sweet Treat for Users
Android Nougat- Sweet Treat for UsersAndroid Nougat- Sweet Treat for Users
Android Nougat- Sweet Treat for Users
 
Installation of linux mint 18 sarah
Installation of linux mint 18 sarahInstallation of linux mint 18 sarah
Installation of linux mint 18 sarah
 
Fedora 24 Release party
Fedora 24 Release partyFedora 24 Release party
Fedora 24 Release party
 
NVIDIA GeForce GTX 1080 Launch
NVIDIA GeForce GTX 1080 LaunchNVIDIA GeForce GTX 1080 Launch
NVIDIA GeForce GTX 1080 Launch
 
Instalasi Ubuntu 16.10 (Yakkety Yak)
Instalasi Ubuntu 16.10 (Yakkety Yak)Instalasi Ubuntu 16.10 (Yakkety Yak)
Instalasi Ubuntu 16.10 (Yakkety Yak)
 
Kaspersky Internet Security Multi-Device 2015
Kaspersky Internet Security Multi-Device 2015Kaspersky Internet Security Multi-Device 2015
Kaspersky Internet Security Multi-Device 2015
 
Microsoft Hyper V Server 2008
Microsoft Hyper V Server 2008Microsoft Hyper V Server 2008
Microsoft Hyper V Server 2008
 
NVIDIA GeForce NOW Cloud Game Streaming at GDC
NVIDIA GeForce NOW Cloud Game Streaming at GDCNVIDIA GeForce NOW Cloud Game Streaming at GDC
NVIDIA GeForce NOW Cloud Game Streaming at GDC
 
ESET Mobile Security & Antivirus
ESET Mobile Security & AntivirusESET Mobile Security & Antivirus
ESET Mobile Security & Antivirus
 
2017 acronis cloud spla 서비스소개
2017 acronis cloud spla 서비스소개2017 acronis cloud spla 서비스소개
2017 acronis cloud spla 서비스소개
 
Whats new v sphere 6
Whats new v sphere 6Whats new v sphere 6
Whats new v sphere 6
 
Red Hat Enterprise Linux: Open, hyperconverged infrastructure
Red Hat Enterprise Linux: Open, hyperconverged infrastructureRed Hat Enterprise Linux: Open, hyperconverged infrastructure
Red Hat Enterprise Linux: Open, hyperconverged infrastructure
 
Honeypot Social Profiling
Honeypot Social ProfilingHoneypot Social Profiling
Honeypot Social Profiling
 

Similaire à Android Nougat (7.0) : Nouveautés Android TV et Direct Boot

Cours android 2016
Cours android 2016Cours android 2016
Cours android 2016Saber LAJILI
 
Développement Android
Développement AndroidDéveloppement Android
Développement AndroidFranck SIMON
 
Initiation au code : Introduction et installation des outils
Initiation au code : Introduction et installation des outilsInitiation au code : Introduction et installation des outils
Initiation au code : Introduction et installation des outilsStéphanie Hertrich
 
Programmation Android - 01 - Introduction
Programmation Android - 01 - IntroductionProgrammation Android - 01 - Introduction
Programmation Android - 01 - IntroductionYann Caron
 
Microsoft Windows 10 Technical Preview sur une machine virtuelle Virtualbox
 Microsoft Windows 10 Technical Preview sur une machine virtuelle Virtualbox Microsoft Windows 10 Technical Preview sur une machine virtuelle Virtualbox
Microsoft Windows 10 Technical Preview sur une machine virtuelle VirtualboxMaggiC solutions, Liège, Belgium
 
Développer des applications pour la TV
Développer des applications pour la TVDévelopper des applications pour la TV
Développer des applications pour la TVMickaël GREGORI
 
MUG Strasbourg - Développement d'une Universal Windows Apps
MUG Strasbourg - Développement d'une Universal Windows AppsMUG Strasbourg - Développement d'une Universal Windows Apps
MUG Strasbourg - Développement d'une Universal Windows Appsmugstrasbourg
 
Gtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogyGtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogySacha Leprêtre
 
Introduction à ASP.NET Core
Introduction à ASP.NET CoreIntroduction à ASP.NET Core
Introduction à ASP.NET CoreMicrosoft
 
Google day ISI - android IOIO
Google day ISI - android IOIOGoogle day ISI - android IOIO
Google day ISI - android IOIOMouafa Ahmed
 
Windows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer TalksWindows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer TalksJean-Sébastien Dupuy
 
Prérequis au développement google android
Prérequis au développement google androidPrérequis au développement google android
Prérequis au développement google androidThierry Gayet
 
Windows phone 8 - Développement de base
Windows phone 8 - Développement de baseWindows phone 8 - Développement de base
Windows phone 8 - Développement de basePatrick Grasseels
 
Tutorial android - créer des apps
Tutorial android - créer des appsTutorial android - créer des apps
Tutorial android - créer des appsNoé Breiss
 
Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1
Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1
Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1SmartnSkilled
 

Similaire à Android Nougat (7.0) : Nouveautés Android TV et Direct Boot (20)

Cours android 2016
Cours android 2016Cours android 2016
Cours android 2016
 
Développement Android
Développement AndroidDéveloppement Android
Développement Android
 
android.pdf
android.pdfandroid.pdf
android.pdf
 
Intro Android
Intro AndroidIntro Android
Intro Android
 
Initiation au code : Introduction et installation des outils
Initiation au code : Introduction et installation des outilsInitiation au code : Introduction et installation des outils
Initiation au code : Introduction et installation des outils
 
Chapitre 4 sem
Chapitre 4 semChapitre 4 sem
Chapitre 4 sem
 
Programmation Android - 01 - Introduction
Programmation Android - 01 - IntroductionProgrammation Android - 01 - Introduction
Programmation Android - 01 - Introduction
 
ROM Android Customs
ROM Android Customs ROM Android Customs
ROM Android Customs
 
Microsoft Windows 10 Technical Preview sur une machine virtuelle Virtualbox
 Microsoft Windows 10 Technical Preview sur une machine virtuelle Virtualbox Microsoft Windows 10 Technical Preview sur une machine virtuelle Virtualbox
Microsoft Windows 10 Technical Preview sur une machine virtuelle Virtualbox
 
Développer des applications pour la TV
Développer des applications pour la TVDévelopper des applications pour la TV
Développer des applications pour la TV
 
MUG Strasbourg - Développement d'une Universal Windows Apps
MUG Strasbourg - Développement d'une Universal Windows AppsMUG Strasbourg - Développement d'une Universal Windows Apps
MUG Strasbourg - Développement d'une Universal Windows Apps
 
Gtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogyGtug2 Mobile app with web technlogy
Gtug2 Mobile app with web technlogy
 
Introduction à ASP.NET Core
Introduction à ASP.NET CoreIntroduction à ASP.NET Core
Introduction à ASP.NET Core
 
Google day ISI - android IOIO
Google day ISI - android IOIOGoogle day ISI - android IOIO
Google day ISI - android IOIO
 
Windows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer TalksWindows Phone 8 for Business - Developer Talks
Windows Phone 8 for Business - Developer Talks
 
Prérequis au développement google android
Prérequis au développement google androidPrérequis au développement google android
Prérequis au développement google android
 
Windows phone 8 - Développement de base
Windows phone 8 - Développement de baseWindows phone 8 - Développement de base
Windows phone 8 - Développement de base
 
Tutorial android - créer des apps
Tutorial android - créer des appsTutorial android - créer des apps
Tutorial android - créer des apps
 
Tutorial android
Tutorial androidTutorial android
Tutorial android
 
Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1
Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1
Support formation vidéo : Maîtriser les fondamentaux d'Android 4.1
 

Android Nougat (7.0) : Nouveautés Android TV et Direct Boot

  • 1. Les nouveautés d’Android Nougat Paris Android User Group Extrait du meetup septembre
  • 2. Edouard Marquez Développeur Android Freelance 2 @g123k +EdouardMarquez www.edouard-marquez.me
  • 4. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Qu’est-ce que le picture in picture (PIP) ? 4
  • 5. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Supporter le picture in picture (Android Manifest) 5 <activity android:name=".MyActivity"
 android:resizeableActivity="true"
 android:supportsPictureInPicture="true"
 android:configChanges="screenSize|smallestScreenSize| screenLayout|orientation" /> Mettre le launchMode en singleTask est recommandé
  • 6. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Supporter le picture in picture (bouton) 6 if (supportsPIP(context)) { adapter.add( new PlaybackControlsRow.PictureInPictureAction(context)); } boolean supportsPIP(Context context) { return BuildCompat.isAtLeastN() && 
 context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_PICTURE_IN_PICTURE); }
  • 7. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Supporter le picture in picture (activer le mode) 7 public void onActionClicked(Action action) { if (action.getId() == R.id.lb_control_picture_in_picture) { getActivity().enterPictureInPictureMode();
 return; } // .... }
  • 8. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Picture in picture 8
  • 9. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Cacher les composants en mode picture in picture 9 void onPictureInPictureChanged(boolean inPictureInPicture) { if (inPictureInPicture) { uiControls.setVisibility(View.INVISIBLE); } else { uiControls.setVisibility(View.VISIBLE); } }
  • 10. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Gestion du lifecycle avec le picture in picture 10 public void onPause() { super.onPause(); if (!inPictureInPicture() && videoView.isPlaying()) { if (!requestVisibleBehind(true)) { playPause(false); } else { requestVisibleBehind(false); } }
  • 11. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV - Picture in picture : Exemple de code 11 Exemple de code
  • 12. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android TV : Enregistrement des chaînes TV 12
  • 14. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Etre notifié du démarrage du terminal <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <receiver android:name=".BootBroadcastReceiver" <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> 14 Intent relatif au démarrage du terminal
  • 15. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 L’application doit avoir été lancée une première fois avant de recevoir l’Intent Depuis Android 3.1 15 Intent relatif au démarrage du terminal
  • 16. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 3.0 (Honeycomb) Février 2011 Support du chiffrement Full Disk Encryption (FDE) 4.4 (KitKat) Novembre 2013 Utilisation de scrypt Sécurité renforcée 7.0 (Nougat) Août 2016 Nouveau type de chiffrement File-Based Encryption (FBE) 5.0 (Lollipop) Novembre 2014 Diverses améliorations Chiffrement sans mot de passe, support schéma… 16 Android : Evolution du chiffrement
  • 17. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Mieux comprendre le chiffrement 5.0 (Lollipop) Novembre 2014 Chiffrement obligatoire … puis non 6.0 (Marshmallow) Septembre 2015 Chiffrement (vraiment) obligatoire 17 Android : Evolution du chiffrement
  • 18. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 — Seuls des mots de passe et PIN peuvent être utilisés — La demande au démarrage est bloquante Android 3.0 - Android 4.4 — Possibilité d’utiliser des schémas — Le démarrage sécurisé devient optionnel Depuis Android 5.0 18 Android : Evolution du chiffrement
  • 19. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 — Aucune application tierce n’est exécutée — Bloque le lancement du terminal Démarrage sécurisé 19 Android : Evolution du chiffrement
  • 20. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Seuls les terminaux sous Android 7.0 peuvent en bénéficier Depuis Nougat Le terminal doit être chiffré Données chiffrées Le chiffrement doit être “basé sur un fichier” File-based encryption 20 Comment obtenir Direct Boot ?
  • 21. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Android Manifest Ajouter android:directBootAware uniquement sur les receivers / services / providers qui seront accessibles au démarrage L’attribut n’apporte rien sur les Activity, car il faut au préalable déverrouiller le terminal Un nouvel Intent est envoyé lors du “direct boot” <receiver android:name=".BootBroadcastReceiver" android:directBootAware="true" android:exported="true"> <intent-filter> <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> 21 Implémenter Direct Boot
  • 22. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Application “système” Il est possible de mettre l’attribut sur le tag application, mais il ne prendra effet que sur les applications “système” <application android:allowBackup="true" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:theme="@style/Theme.AppCompat.Light" android:directBootAware="true"> 22 Implémenter Direct Boot
  • 23. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Stockage disponible uniquement après le premier déverrouillage Credential Encrypted (CE) storage Stockage disponible avant et après le premier déverrouillage Device Encrypted (DE) storage 23 Les deux types de stockage
  • 24. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Utiliser le stockage DE Il faut récupérer un Context différent Deux méthodes permettent de déplacer facilement les préférences et bases de données dans leur globalité Context context = 
 ContextCompat.createDeviceProtectedStorageContext(srcContext); ContextCompat.isDeviceProtectedStorage(context); context.moveDatabaseFrom(srcContext, "dbName"); context.moveSharedPreferencesFrom(srcContext, "prefName"); 24 Utiliser le stockage DE (accessible avant le déverrouillage)
  • 25. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Application “système” Il est possible d’ajouter un attribut le tag application afin que seul le stockage “DE” soit utilisé <application android:allowBackup="true" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:theme="@style/Theme.AppCompat.Light" android:directBootAware="true" android:defaultToDeviceProtectedStorage="true"> 25 Utiliser le stockage DE (accessible avant le déverrouillage)
  • 26. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Tester Direct Boot — Paramètres -> Options pour les développeurs -> Convertir en chiffrement basé sur un fichier — adb reboot bootloader
 fastboot --wipe-and-use-fbe Emulation de Direct Boot — adb shell sm set-emulate-fbe true — adb shell sm set-emulate-fbe false 26 Tester Direct Boot
  • 27. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 android.intent.action.BOOT_COMPLETED android.intent.action.USER_PRESENT 27 L’évolution des Intent envoyés : avant Nougat
  • 28. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 android.intent.action.LOCKED_BOOT_COMPLETED android.intent.action.USER_PRESENT puis android.intent.action.BOOT_COMPLETED android.intent.action.ACTION_USER_UNLOCKED 28 L’évolution des Intent envoyés : avec Nougat et sans Direct Boot
  • 29. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 android.intent.action.LOCKED_BOOT_COMPLETED android.intent.action.BOOT_COMPLETED android.intent.action.ACTION_USER_UNLOCKED puis android.intent.action.USER_PRESENT 29 L’évolution des Intent envoyés : avec Nougat et Direct Boot
  • 30. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 30 Direct Boot : juste un dernier slide — Chaque utilisateur possède ses propres clés — Une pour le DE, l’autre pour CE Support multi-utilisateur Exemple de code UserManagerCompat. isUserUnlocked(context)); Déverrouillé ?
  • 32. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Raccourci vers les paramètres 32
  • 33. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Raccourci vers les paramètres 33 Paramètres Dans l’AndroidManifest, spécifier un Intent-Filter particulier Afin d’éviter que d’autres applications puissent ouvrir cette Activité, on peut limiter à une permission Il n’est pas nécessaire que l’Activité soit exportée <activity android:name=".MyActivity" android:permission="android.permission.WRITE_SECURE_SETTINGS"> <intent-filter> <action android:name="android.intent.action.APPLICATION_PREFERENCES"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity>
  • 34. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Résolution des langues 34 Default (en) fr_BE en_UK es_ES de_DE ru_RU fr_FR
  • 35. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Résolution des langues (pre-Nougat) 35 fr_FR existe-il ? Non juste fr_BE fr existe-il ? Non Valeur par défaut (en)
  • 36. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Résolution des langues (depuis Nougat) 36 fr_FR existe-il ? Non juste fr_BE fr existe-il ? Non Existe-t-il un autre type de fr ? Oui fr_BE
  • 37. Les nouveautés d’Android Nougat (7.0) Paris Android User Group (bit.ly/paugand) PARTIE 1 PARTIE 2 PARTIE 3 PARTIE 4 PARTIE 5 PARTIE 6 Langues multiples 37 Récupérer les différentes langues LocaleList.getDefault() Support de ICU4J
  • 38. Merci ! Questions ? @g123k +EdouardMarquez