$30 off During Our Annual Pro Sale. View Details »

I/O Extended Jakarta - What's new in Android

I/O Extended Jakarta - What's new in Android

Yacine Rezgui

July 20, 2019
Tweet

More Decks by Yacine Rezgui

Other Decks in Programming

Transcript

  1. I’m Yacine Rezgui Android developer advocate in London First time

    in Indonesia ! Follow me on Twitter @yrezgui Hi Jakarta
  2. Important Q themes Performance Address painful gaps in performance, gaming,

    outreach, and UI development. Privacy Ensure users have transparency, controls and safeguards around data on their device. Updatability Modularize key components to enable updates outside of OS releases.
  3. Important Q themes Performance Address painful gaps in performance, gaming,

    outreach, and UI development. Privacy Ensure users have transparency, controls and safeguards around data on their device. Updatability Modularize key components to enable updates outside of OS releases.
  4. Background location access Finer grained control of location permission and

    location sharing reminders. Storage Compartmentalizing storage to collections; limiting broad access to common storage. Device IDs Immutable device identifiers will be restricted to privileged apps. Background app launching Limiting the ability for apps to auto-launch to the foreground. Major privacy changes
  5. Background location access Finer grained control of location permission and

    location sharing reminders. Storage Compartmentalizing storage to collections; limiting broad access to common storage. Device IDs Immutable device identifiers will be restricted to privileged apps. Background app launching Limiting the ability for apps to auto-launch to the foreground. Major privacy changes
  6. App storage today Common storage Private app storage Accessible by

    own app by default Accessible by any apps with storage permission
  7. App storage today - permissions List of all apps on

    the device and usage data via timestamps User’s Location history - via geolocation tag in pictures App download files with PII - via access to all files
  8. Proprietary + Confidential Common storage Changes in Android Q Private

    app storage Isolated sandbox storage • No longer see the top-level shared storage area • Isolated storage sandbox ◦ Private to apps ◦ No permissions needed ◦ Context.getExternalFilesDir(... ) - remains intact ◦ Removed upon uninstallation
  9. Proprietary + Confidential Common storage Changes in Android Q Private

    app storage Photo/Video Audio Downloads • Photo/Video and Audio collections • No permissions needed to access own(self-contributed) files • To access files created by others: Use “READ_EXTERNAL_STORAGE” permission • Access via MediaStore API Isolated sandbox storage
  10. Proprietary + Confidential Common storage Changes in Android Q Private

    app storage Photo/Video Audio Downloads • Download collection • No permissions needed to contribute and view own files in common collections • Without relevant permission apps will only see self-contributed content • Files in common collections will survive app uninstallation Isolated sandbox storage
  11. Proprietary + Confidential Common storage Changes in Android Q Private

    app storage Photo/Video Audio Downloads • Download files accessed through the system file picker (ACTION_OPEN_DOCUMENT) Isolated sandbox storage
  12. Proprietary + Confidential Common storage Changes in Android Q Private

    app storage Photo/Video Audio Downloads Isolated sandbox storage Permissions No No Only needed to access files created by others App uninstalls Files removed Files stay Files stay Access getExternalFilesDir MediaStore Storage Access Framework
  13. Proprietary + Confidential Compatibility mode Installed on P then upgraded

    to Q Installed on Q Target SDK level P Granted old storage permission allows app to read all external storage directories. App operates similar as on P Target SDK level Q App can see MediaStore and collections content using new storage model.
  14. Background location access Finer grained control of location permission and

    location sharing reminders. Storage Compartmentalizing storage to collections; limiting broad access to common storage. Device IDs Immutable device identifiers will be restricted to privileged apps. Background app launching Limiting the ability for apps to auto-launch to the foreground. Major privacy changes
  15. Proprietary + Confidential Android Q Workshop Proprietary + Confidential requestPermissions(

    arrayOf( 1002 ) Request Background Access Deny Allow only while using the app Allow all the time ACCESS_FINE_LOCATION ACCESS_BACKGROUND_LOCATION
  16. Takeaways • Affects only apps with targetSDK 29 • Introduce

    ACCESS_BACKGROUND_LOCATION • Focus on the Manifest.permissions you need
  17. Device location Finer grained control of location permission and location

    sharing reminders. Storage Compartmentalizing storage to collections; limiting broad access to common storage. Device IDs Immutable device identifiers will be restricted to privileged apps. Background app launching Limiting the ability for apps to auto-launch to the foreground. Major privacy changes
  18. New READ PHONE STATE PRIVILEGED permission, restricted to preloaded apps.

    Build.SERIAL, Build.getSerial() Device IDs TelephonyManager: IMEI, MEID, ESN, IMSI
  19. Device location Finer grained control of location permission and location

    sharing reminders. Storage Compartmentalizing storage to collections; limiting broad access to common storage. Device IDs Immutable device identifiers will be restricted to privileged apps. Background app launching Limiting the ability for apps to auto-launch to the foreground. Major privacy changes
  20. Background app launching (P) “So I had the scariest ride

    of my life last night. The driver kept having ads pop up over his navigation. We had a couple of lovely swerves and missed our exit because this was covering navigation.”
  21. Android Q Apps can only start activities when they are

    visible, or as a result of user interaction. An app that is not in use cannot decide to launch itself to the foreground. Applies to all apps – independent of target API
  22. Proprietary + Confidential 1 The app has a visible window

    (e.g. top activity) 2 The app has an activity in the foreground task stack 3 A visible app binds to a service of the app 4 A visible app sends a pending intent of the app Exemptions Activity starts allowed when:
  23. Are you affected? • Are there any situations where you

    currently launch activities from the background? • Review your codebase • Enabled in permissive mode in Q Beta
  24. Apps Migration needed • Comms app: incoming calls • Alarms

    Clock: ongoing alarms • Cross device authentication • Launching activity after crashes detected in the background
  25. ContactsProvider2: no interaction data; no social graph! Default SMS app:

    cannot retain permissions if app loses default status. ActivityRecognition: now under runtime permission. USB Serial: only after USB permission! More privacy
  26. Passive location: from 6x to 2x; less data for user

    Camera Characteristics: null without camera permission. App Icon Hiding: apps in data partition can no longer hide icon. MAC Randomization random addresses when probing for new networks. More privacy
  27. Hardware trends over time Body size Screen size Screen-to-body App-to-chrome,

    foldables… 2020 Differentiation shifts over time
  28. Enabling apps to occupy more of the screen and render

    from top edge to bottom edge (edge-to-edge) Proprietary + Confidential Platform wants to reduce fragmentation & be more modern Introducing fully gestural navigation as a default-able mode in the platform All nav bar buttons replaced by gestures
  29. Proprietary + Confidential A quick look at gestural navigation Home

    Back Recents Back Home is a swipe up from bottom Recents is a swipe up and hold from bottom Back is a swipe from both left and right edges
  30. 1 Drawing edge-to-edge 2 Taking advantage of all the Insets

    3 Overriding system gestures Preparing for gesture nav and edge-to-edge UI
  31. • From Q onwards, the System is responsible for recoloring

    system buttons/handles. • For older devices, recommend setting a translucent nav bar color. • Recoloring can be in the form of dynamic color adaptation or a static coloring. Dynamic color adaptation System will help with edge-to-edge
  32. • Apps can let the system know where it wants

    gestures via new View API: setSystemGestureExclusionRects(List<Rect>) • System required to respect these overrides for everything up to 200 dp on each side except the Home gesture. • Drawer and seek bars will support this out-of-box closer to the Q release. Overriding system gestures
  33. • Share sheet ◦ Huge improvement in features and speed

    • Dark Theme ◦ Save phone’s battery and make it look cool • Live Caption ◦ Accessibility in all media streams • Wi-Fi network suggestion API ◦ Propose to connect to a WiFi network without typing credentials • Project Mainline ◦ Security updates through Google Play More news!
  34. Beta 4 June 2019 Final API’s Q Timeline Beta 5/6

    Q3 2019 Release Candidate Release Q3 2019 Consumer OTA
  35. • Project Marble • Improvements on memory usage • Emulator

    battery usage • Incremental annotation processing for databinding • Incremental annotation processing for Kotlin • Apply Changes • Conditional delivery for dynamic feature modules • Chrome OS support • Intellij 2019.1 Android Studio 3.5
  36. 1 Many new Jetpack APIs and features will be offered

    first in Kotlin 2 If you’re starting a new project, you should write it in Kotlin 3 Code written in Kotlin often mean much less code for you → Less code to type, test, and maintain Kotlin
  37. • Autofill • Security ◦ Easy encryption on disk for

    Android 6+ • Camera X ◦ Ease of use and device compatibility • Benchmark, it has been used for the Jetpack libraries ◦ Warm-up periods, removing outliers, and locking CPU clocks Android Jetpack
  38. • Next gen Declarative UI toolkit • Based on Kotlin

    compile plugin which provides reactive tree construction • Now released as experimental library under AOSP Jetpack Compose
  39. • Fully declarative for defining UI components ◦ One language,

    one file to master to rule them all • Provide reusable building blocks ◦ Let you build custom widgets easier without starting from scratch • Compatible with existing views ◦ You can mix and match and adopt at your own pace • Material Design out of the box and animations from the start Jetpack Compose