Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's new in Android O

What's new in Android O

What's new in Android O?

Avatar for Naseem

Naseem

May 08, 2017

Other Decks in Programming

Transcript

  1. Agenda • Background limits • Notifications • Autofill APIs •

    Picture in picture • Font resources in XML • Adaptive icons • Wide-gamut color for apps • Connectivity • Keyboard navigation • WebView enhancements • Security & Privacy • Java 8 • And more... • Summray
  2. What’s a Foreground App? App is foreground when: • It

    has a visible activity. • It has foreground service. • Another foreground is connected to the app. Note: Wake locks will be released (cached state)
  3. No background anymore! • No background services. • Short window

    until Service.stopSelf(). • IllegalArgumentException: ◦ Service.startService(). ◦ PendingIntent Service.
  4. No background anymore! (but) • Handling a high-priority Firebase Cloud

    Messaging (FCM) message. • Receiving a broadcast, such as an SMS/MMS message. • Executing a PendingIntent from a notification.
  5. JobScheduler • Wrapper around background activity • Schedule base on:

    ◦ Time window ◦ Network type ◦ Device charging ◦ Device charging & unused ◦ Content provide • API >=21
  6. JobScheduler • Wrapper around background activity • Schedule base on:

    ◦ Time window ◦ Network type ◦ Device charging ◦ Device charging & unused ◦ Content provide • API >=21
  7. Android Job by evernote • Single API to use: ◦

    AlaramManager ◦ JobSchedule ◦ GCM Network • No manifest! • No need for Play Services • API >=14
  8. Background? Library Min API Requires Google Play Service API1 Custom

    retry strategies JobScheduler 21 No JobScheduler Yes JobDispatcher 9 Yes JobScheduler Yes Android Job 14 No2 Custom Yes 1: Refers to the methods that need to be implemented in the Service subclass. 2: Uses AlarmManager to support API levels <= 21 if Google Play services is unavailable.
  9. Broadcast Limitations • No Manifest-declared Implicit Broadcast anymore! ◦ No

    PACKAGE_ADDED ◦ No ACTION_PACKAGE_REPLACED, but you can use ACTION_MY_PACKAGE_REPLACED (explicit) ◦ Can be defined in run time. • Exceptions ◦ ACTION_BOOT_COMPLETED ◦ ACTION_HEADSET_PLUG ◦ ACTION_LOCALE_CHANGED ◦ Full list https://developer.android.com/preview/features/background-broadcasts.html
  10. Background location limits Who is Affected: • Fused Location Provider

    (FLP) • Geofencing • GNSS Measurements • Location Manager How this will effects: • Background apps receive location updates less frequently.
  11. Notification • Notification channels • Snoozing • Notification timeout •

    Notification dismissal • Background colors • Messaging style • Notification Badges
  12. Autofill framework • Less time spent in filling fields Autofill

    saves users from re-typing information. • Minimize user input errors
  13. Font resources in XML Android custom fonts: XML: • Style.xml

    (>21 & only Roboto fonts) Programmatically: • Use Custom TextView (And load custom ttf file from assest) • SetTypeface
  14. Wide-gamut color for apps • Current is limited to sRGB

    • New API helps ◦ To display ◦ Converting between colour spaces
  15. Connectivity & Telecom framework • High-quality Bluetooth audio (LDAC codec)

    • New Wi-Fi features ◦ Wi-Fi Aware (NAN) • Telecom framework ◦ VoIP
  16. WebView enhancements • Version API • Google Safe Browsing API

    • Termination Handle API • Renderer Importance API
  17. Supported Java 8 Language Using Jack toolchain • Default and

    static interface methods (>=24) • Repeatable annotations (>=24) • Lambda expressions • Method References • Type Annotations Using Default toolchain • Default and static interface methods (>=24) • Repeatable annotations • Lambda expressions • Method References • Type Annotations • faster build speed • Instant Run • 3rd party libraries written with Java 8 is also supported
  18. Java 8 APIs Java 8 Language API (>=24) • java.lang.annotation.Repeatable

    • AnnotatedElement.getAnnotationsByType(Class) • java.util.stream • java.lang.FunctionalInterface • java.lang.reflect.Method.isDefault() • java.util.function
  19. Java 8 - getting started • Need Android Studio 2.4

    • Android Plugin for Gradle 2.4
  20. Security • SSLv3 is not supported! • HttpsURLConnection could fail

    when using a bad TLS. • Secure Computing (SECCOMP) filter to all apps • WebView objects now run in multiprocess mode • App APK path is changed! • Native libraries
  21. Permissions Prior Android O: When requesting a permission, all the

    permissions under the same group will be granted. Android O: When requesting a permission, only the requested permissions are granted, however if the app later requests any permission under the same permission group, it will be granted without prompting the user.
  22. Privacy (How to identify) • Hardware identifiers: ◦ IMEI ◦

    ANDROID ID (CHANGED!) ◦ MAC addresses (<Android 6) • Advertising ID (resettable) • Net.hostname (deprecated!)
  23. Privacy (ANDROID ID) Prior Android O: • Same across Apps.

    Android O: • Unique to each App. • Invariable.
  24. Picture-in-Picture mode (PIP) • PIP is a special type of

    multi-window mode mostly used for video playback. • Multi-window lifecycle.
  25. Accessibility • Language detection • Accessibility button • Fingerprint gestures

    • Word-level highlighting • Hint text • Continued gesture dispatch
  26. And More • New account access and discovery APIs •

    AnimatorSet • Autosizing TextView • Smart sharing • App categories • New StrictMode detectors (detectUnbufferedIo() /detectContentUriWithoutPermission() /detectUntaggedSockets() ) • Cached data • Improved media file access • Pinning Shortcuts and Widgets • Content provider paging • New Permissions (answer phone call) • Android enterprise profile
  27. Getting prepared Supporting Android O: • Background Location Limits •

    Native libraries • Locating APKs • Querying the net.hostname is not supported! Targeting Android O: • Background Service Limitations • Broadcast Limitations • Notifications • Network security configuration • The system properties net.dns1, net.dns2, net.dns3, and net.dns4 are no longer available • Build.SERIAL is deprecated • Permissions • Collection handling
  28. Getting prepared Supporting Android O: • Background Location Limits •

    Native libraries • Locating APKs • Querying the net.hostname is not supported! Targeting Android O: • Background Service Limitations • Broadcast Limitations • Notifications • Network security configuration • The system properties net.dns1, net.dns2, net.dns3, and net.dns4 are no longer available • Build.SERIAL is deprecated • Permissions • Collection handling
  29. Data collected during a 7-day period ending on May 2,

    2017. Any versions with less than 0.1% distribution are not shown.