What’s new in
Android O
Android Changes
Notification Channels
Notification Channels
NotificationChannel channel = new NotificationChannel(
PRIMARY_CHANNEL,
getString(R.string.noti_channel_default),
NotificationManager.IMPORTANCE_DEFAULT);
channel.setLightColor(Color.GREEN);
channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
mNotificationManager.createNotificationChannel(channel);
new Notification.Builder(context, PRIMARY_CHANNEL)
.setContentTitle(title)
.setContentText(body)
.setSmallIcon(getSmallIcon())
.setAutoCancel(true)
Notification Channels
CharSequence name = getString(R.string.noti_channel_group_default);
NotificationChannelGroup group =
new NotificationChannelGroup(DEFAULT_CHANNELS_GROUP_ID, name);
mNotificationManager.createNotificationChannelGroup(group);
Notification Channels
CharSequence name = getString(R.string.noti_channel_group_default);
NotificationChannelGroup group =
new NotificationChannelGroup(DEFAULT_CHANNELS_GROUP_ID, name);
mNotificationManager.createNotificationChannelGroup(group);
NotificationChannel channel = new NotificationChannel(
PRIMARY_CHANNEL,
getString(R.string.noti_channel_default),
NotificationManager.IMPORTANCE_DEFAULT);
channel.setGroup(DEFAULT_CHANNELS_GROUP_ID);
mNotificationManager.createNotificationChannel(channel);
Title with black text on black is background is bug of Android O Preview 1
Channel properties
• Importance
• Sound
• Lights
• Vibration
• Show on lockscreen
• Override do not disturb
• Badge in Launcher
Notifications API Changes
• Channel is required for all Notifications
• Notification priority is no effect, use channel
priorities instead.
• NotificationListenerService now can understand in
new onNotificationRemoved() method, that
notification was dismissed by a user or remove by
an app
Notification.Builder API Changes
• Notification.Builder(Context) is deprecated

Use Notification.Builder(Context, String) instead
• setTimeout() 

Specify a duration after which a notification should be cancelled
• setColorized()

Set whether notification should be colorized. Color of notification
that was set by setColor() will be used as background color.
• chooseBadgeIcon()

Set type of icon to display as a badge for this notification
• setShortcutId()

Launcher can hide the shortcut, that notification duplicate. Ignored
be Launchers that don’t support badging or shortcuts.
Background Service Limitations
Background Service Limitations
Foreground
Processes
Visible
Processes
Service
Processes
Background
Processes
Empty
Processes
Background Service Limitations
Foreground
Processes
Visible
Processes
Background
Processes
Empty
Processes
Several
minutes
Background Service Limitations
• Not applying for foreground apps
• Not applying for bounded Services
• System places background app on a temporary
whitelist for several minutes
• Handling high-priority FCM message
• Receiving broadcast such as SMS message
• Executing a PendingIntent from a notification
• Applying only for apps that target Android O
Foreground App
• Has a visible Activity (started or paused)
• Has foreground Service
• Another foreground app is connected to the app

Bind to one of its services or use one of its Content Providers
Broadcast Limitations
<receiver android:name=".SampleReceiver">
<intent-filter>
<action
android:name=“android.intent.action.PACKAGE_ADDED”
/>
</intent-filter>
</receiver>
Not work
in Android O
Broadcast Limitations
Broadcast Limitations
• Apps can no longer register Broadcast Receivers for
implicit broadcasts in manifest
• Explicit broadcasts not affected
• Registration for any broadcast using
Context.registerReceiver() at runtime not affected
• Limitation apply only to apps that target Android O
• A number of implicit broadcast are currently
exempted from this limitations
Some of exempted implicit
broadcasts
• ACTION_LOCALE_CHANGED
• ACTION_HEADSET_PLUG
• ACTION_CONNECTION_STATE_CHANGED

For BluetoothHeadset
• ACTION_NEW_OUTGOING_CALL
• ACTION_PACKAGE_FULLY_REMOVED
• ACTION_DEVICE_STORAGE_LOW
List of exempted actions can be changed before final release
How app must work in
new conditions?
JobScheduler
• Network conditions
• Charging state
• Idle state
• Time of execution
• Period
• Deadline
• Latency
• Can be persisted across device reboots
• Can be triggered based on Content provider changes
• Work with Doze & App Standby restrictions
Background Execution Limits
• System release all wakelocks when the app enters the
cached state (not active components)
• App in background receive location update only a few
times each hour

* Maybe changed in next Developer Previews
• The Service.startForeground() no longer works. Use
NotificationManager.startServiceInForeground() instead.

Affected to apps that target Android O
• The Context.startService() now throws an
IllegalStateExceptions if an app tries to use that method
where the Service will be restricted
Font Resource
Font Resource
Font Family
<?xml version="1.0" encoding="utf-8"?>
<font-family
xmlns:android="http://schemas.android.com/apk/res/android">
    <font
        android:fontStyle="normal"
        android:fontWeight="400"
        android:font=“@font/lobster_regular"
/>
    <font
        android:fontStyle="italic"
        android:fontWeight="400"
        android:font=“@font/lobster_italic"
/>
</font-family>
Adding fonts to a TextView
<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="@font/lobster"/>
<style name=“TextAppearance.CustomFont”
parent="@android:style/TextAppearance.Small">
    <item name="android:fontFamily">@font/lobster</item>
</style>
Typeface typeface = getResources().getFont(R.font.lobster);
textView.setTypeface(typeface);
Adaptive icons
Adaptive icons
New launcher icons rules
• Both layers must be sized at 108 × 108 dp
• The inner 72 × 72 dp of the icon appears within the
masked viewport
• Outer 36 dp on each sides reserved for visual
effectes
Adaptive icon sample
<maskable-icon>
    <background android:drawable="@color/ic_background"/>
    <foreground android:drawable="@mipmap/ic_foreground"/>
</maskable-icon>
Autosizing TextView
Autosizing TextView
• Granularity

Choose the best text size based on available space in range on
minimum & maximum sizes & a dimension that specifies the size
of step
• Preset Sizes

Choose the best text size from predefined sizes
Granularity Autosizing
<TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:autoSizeText="uniform"
  android:autoSizeMinTextSize="12sp"
  android:autoSizeMaxTextSize="100sp"
  android:autoSizeStepGranularity="2sp"
/>
Preset Sizes Autosizing
<resources>
    <array name="autosize_text_sizes">
        <item>10sp</item>
        <item>12sp</item>
        <item>20sp</item>
        <item>40sp</item>
        <item>100sp</item>
    </array>
</resources>
<TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:autoSizeText="uniform"
  android:autoSizePresetSizes=
"@array/autosize_text_sizes"
/>
Pinning Shortcuts
Pinning Shortcuts
Pinning shortcuts
ShortcutManager shortcutManager =
context.getSystemService(ShortcutManager.class);
if (shortcutManager.isRequestPinShortcutSupported()) {
    ShortcutInfo pinShortcutInfo =
new ShortcutInfo.Builder(context, “my-shortcut”)
.setShortLabel(“Sample”)
.setIntent(new Intent(“open_from_pinned_shortcut”))
.build();
    shortcutManager.requestPinShortcut(pinShortcutInfo, null);
}
Pinning Shortcuts requirements
• Default launcher must support pinning shortcuts
• When you attempt to pin a shortcut onto launcher,
the user receives a confirmation dialog asking their
permission to pin the shortcut
• ShortcutInfo requires short label & intent (or target
Activity)
• You can also pin App Widgets onto the launcher
Java API updates
Java 8 Date & Time
• Separated Date & Times classes
• Duration & Period classes
• Immutable
• Thread-safe
*You can user backport of Java 8 Date & Time - ThreeTen
Java 7/8 NIO API
• Path
• Stream API for files
• Work with file system info
• WatchService
Other Java API updates
• java.lang.invoke

Dynamic language support provided directly be the Java core class
libraries & VM
• java.util.Collections
• Collections.sort() is implemented on top of List.sort()
• Added checked, empty, synchronised & unmodifiable
wrapper method for NavigableMap & NavigableSet
Android SDK Updates
Fragments
• Postpone Fragment enter transition

FragmentTransaction.postOnCommit(Runnable)
• Fragment lifecycle callback
• Primary Fragment
• Optimizations for FragmentTransactions
Permissions
• The app targeting Android O granted permissions it
has explicitly requested.

Once the user grants a permission to the app, all request for
permissions in that permission group are automatically granted
• Added android.permission.ANSWER_PHONE_CALLS

Allows apps to answer incoming phone calls

This is dangerous permission

Part of PHONE permission group
Cached data
• StorageManager.getCacheQuotaBytes()

Get disk space quota for cached data for the app
• New per-directory control how the system frees up cached data
• StorageManager.setCacheBehaviorAtomic()

All file in directory must be removed together
• StorageManager.setCacheBehaviorTombstone()

Do not delete files. Instead they should be truncated to be 0 bytes in length,
leaving the empty file intact
• Allocate disk space for files using StorageManager.allocateBytes()

It will automatically trigger clear cached files of the app & other apps (as needed) to
meet you request
• Use StorageManager.getAllocatableBytes() instead of using
File.getUsableSpace() for check is the device has enough disk
space to hold new data

It will consider any cached data the system is willing to clear on your behalf
Content Provider
• New query method with selection & sort params in
queryArgs Bundle
• Explicit refresh of content identified by URI

Use refresh(Uri, Bundle, CancelationSignal)
• Query pagination
• Content Provider usage stats change for all apps

Query for usage data of Contact provider now return approximations
rather then exact values for TIMES_CONTACTED, TIMES_USED,
LAST_TIME_CONTACTED, LAST_TIME_USED
• Behavior changes of ContentResolver.notifyChange() &
ContentResolver.registerContentObserver()

Require a valid ContentProvider for the authority in all URIs
Content Provider Paging
// Create bundle with queryArgs
Bundle queryArgs = new Bundle(4);
queryArgs.putString(
ContentResolver.QUERY_ARG_SQL_SELECTION, …);
queryArgs.putStringArrayList(
ContentResolver.QUERY_ARG_SQL_SELECTION_ARGS, …);
queryArgs.putInt(ContentResolver.QUERY_ARG_OFFSET, 0);
queryArgs.putInt(ContentResolver.QUERY_ARG_LIMIT, 100);
Uri contentUri = …;
context.getContentResolver().query(contentUri, queryArgs, null);
Multi-display support
• Enhanced support for multiple displays
• User can move the Activity from one display to
another

If an activity supports multi-window mode.
• System resizes the Activity and issues runtime
changes as necessary, when an Activity is moved
between displays
• ActivityOptions contains new methods for control
display the Activity launch
WebView APIs
• Multiprocess WebView

Web content is handled in a separate, isolated process from the
containing app’s process
• Version API

Fetching information of app displaying web content in you app
• Google SafeBrowsing API

Verify URLs. using Google Safe Browsing
• Termination Handle API

Handling situations when system kills renderer process of WebView
• Renderer Importance API

Set a priority policy for the renderer assigned to a particular
WebView
Strict mode
• detectUnbufferedIo()

Detect when app access to data without buffering
• detectContentUriWithoutPermission()

Detect when app accidentally forgets to grant permissions to
another app when starting an Activity outside your app
• detectUntaggedSockets()

Detect when your app performs network traffics without using set
TrafficStats.setThreadStateTag() to tag your traffic for debugging
purposes
App categories
• Use to cluster together apps of similar purpose
when presenting them to users, such as in Data
Usage or Battery Usage
• Set android:appCategory attribute in your
<application> manifest tag
• Categories: audio, game, image, maps, news,
productivity, social, video
AccountManager API
• Control of visibility of accounts for other applications
• Now you can listen accounts updates only for
specified account types
• Apps can no longer get access to user accounts
unless the authenticator owns the accounts or the
user grants that access. 

The GET_ACCOUNTS permission is no longer sufficient. Use
AccountManager.newChooseAccountIntent() to grant access.
• LOGIN_ACCOUNTS_CHANGED_ACTIONS is deprecated

Use AccountManager.addOnAccountsUpdatedListener() during
runtime
Smart sharing
Intent intent = new Intent(Intent.ACTION_CHOOSER);
ArrayList<String> annotations = new ArrayList<>(3);
annotations.add("person");
annotations.add("selfie");
annotations.add("child");
intent.putStringArrayListExtra(
    Intent.EXTRA_CONTENT_ANNOTATIONS, annotations);
Alert windows changes
App that uses the SYSTEM_ALERT_WINDOW
permission & use one of the following window types
to display alert windows:
• TYPE_PHONE
• TYPE_PRIORITY_PHONE
• TYPE_SYSTEM_ALERT
• TYPE_SYSTEM_OVERLAY
• TYPE_SYSTEM_ERROR
Alert windows changes
• For apps that not target Android O, it will be
displayed beneath the windows, that use the
TYPE_APPLICATION_OVERLAY window type.
• Apps that target Android O can no longer use that
window types to display alert windows above other
apps & system windows. Instead, use new window
type called TYPE_APPLICATION_OVERLAY
Other updates
• View.findViewById() & View.findViewByTag() now
return generic type

No need cast anymore. Activity.findViewById() not changed
• View Tooltip
Other updates
Other updates
• View.findViewById() & View.findViewByTag() now
return generic type

No need cast anymore. Activity.findViewById() not changed
• View Tooltip
• JobInfo transient extras
• AnimatorSet seeking & reverse playing
• Update Android ICU to version 58
• Settings.Secure.ANDROID_ID is unique for each app
& user
• SSLv3 no longer supported
Other updates
• Build.SERIAL is deprecated. Use Build.getSerial()
instead.

Build.getSerial() requires READ_PHONE_STATE permission
• android.app.ProgressDialog is deprecated
• Color mode in Configuration
Other Features
• Autofill Framework
• Picture-in-Picture for all
• Color management
• Wi-Fi Aware
• Companion device pairing
• Accessibility updates
• Media enhancements
Program overview
DP1 - alpha
DP2 - beta (Google I/O 2017?)
DP3 - Final APIs & SDK, Play publishing

DP4 - pre-final images
Try Android O Developer Preview
1. Install Android Studio 2.4

Use different Android SDK with stable Android 2.3
2. Download:
1. SDK & tools
2. Emulator image
3. Support libraries
3. Run emulator

Emulator only work if you ANDROID_SDK & ANDROID_SDK_ROOT
environment for Android SDK from Android Studio 2.4 

Use emulator tools from canary Android SDK for work with
emulator
More about Android O on

d.android.com/preview

What's new in Android O

  • 1.
  • 2.
  • 15.
  • 16.
    Notification Channels NotificationChannel channel= new NotificationChannel( PRIMARY_CHANNEL, getString(R.string.noti_channel_default), NotificationManager.IMPORTANCE_DEFAULT); channel.setLightColor(Color.GREEN); channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE); mNotificationManager.createNotificationChannel(channel); new Notification.Builder(context, PRIMARY_CHANNEL) .setContentTitle(title) .setContentText(body) .setSmallIcon(getSmallIcon()) .setAutoCancel(true)
  • 17.
    Notification Channels CharSequence name= getString(R.string.noti_channel_group_default); NotificationChannelGroup group = new NotificationChannelGroup(DEFAULT_CHANNELS_GROUP_ID, name); mNotificationManager.createNotificationChannelGroup(group);
  • 18.
    Notification Channels CharSequence name= getString(R.string.noti_channel_group_default); NotificationChannelGroup group = new NotificationChannelGroup(DEFAULT_CHANNELS_GROUP_ID, name); mNotificationManager.createNotificationChannelGroup(group); NotificationChannel channel = new NotificationChannel( PRIMARY_CHANNEL, getString(R.string.noti_channel_default), NotificationManager.IMPORTANCE_DEFAULT); channel.setGroup(DEFAULT_CHANNELS_GROUP_ID); mNotificationManager.createNotificationChannel(channel);
  • 19.
    Title with blacktext on black is background is bug of Android O Preview 1
  • 20.
    Channel properties • Importance •Sound • Lights • Vibration • Show on lockscreen • Override do not disturb • Badge in Launcher
  • 21.
    Notifications API Changes •Channel is required for all Notifications • Notification priority is no effect, use channel priorities instead. • NotificationListenerService now can understand in new onNotificationRemoved() method, that notification was dismissed by a user or remove by an app
  • 22.
    Notification.Builder API Changes •Notification.Builder(Context) is deprecated
 Use Notification.Builder(Context, String) instead • setTimeout() 
 Specify a duration after which a notification should be cancelled • setColorized()
 Set whether notification should be colorized. Color of notification that was set by setColor() will be used as background color. • chooseBadgeIcon()
 Set type of icon to display as a badge for this notification • setShortcutId()
 Launcher can hide the shortcut, that notification duplicate. Ignored be Launchers that don’t support badging or shortcuts.
  • 23.
  • 24.
  • 25.
  • 26.
    Background Service Limitations •Not applying for foreground apps • Not applying for bounded Services • System places background app on a temporary whitelist for several minutes • Handling high-priority FCM message • Receiving broadcast such as SMS message • Executing a PendingIntent from a notification • Applying only for apps that target Android O
  • 27.
    Foreground App • Hasa visible Activity (started or paused) • Has foreground Service • Another foreground app is connected to the app
 Bind to one of its services or use one of its Content Providers
  • 28.
  • 29.
  • 30.
    Broadcast Limitations • Appscan no longer register Broadcast Receivers for implicit broadcasts in manifest • Explicit broadcasts not affected • Registration for any broadcast using Context.registerReceiver() at runtime not affected • Limitation apply only to apps that target Android O • A number of implicit broadcast are currently exempted from this limitations
  • 31.
    Some of exemptedimplicit broadcasts • ACTION_LOCALE_CHANGED • ACTION_HEADSET_PLUG • ACTION_CONNECTION_STATE_CHANGED
 For BluetoothHeadset • ACTION_NEW_OUTGOING_CALL • ACTION_PACKAGE_FULLY_REMOVED • ACTION_DEVICE_STORAGE_LOW List of exempted actions can be changed before final release
  • 32.
    How app mustwork in new conditions?
  • 33.
    JobScheduler • Network conditions •Charging state • Idle state • Time of execution • Period • Deadline • Latency • Can be persisted across device reboots • Can be triggered based on Content provider changes • Work with Doze & App Standby restrictions
  • 34.
    Background Execution Limits •System release all wakelocks when the app enters the cached state (not active components) • App in background receive location update only a few times each hour
 * Maybe changed in next Developer Previews • The Service.startForeground() no longer works. Use NotificationManager.startServiceInForeground() instead.
 Affected to apps that target Android O • The Context.startService() now throws an IllegalStateExceptions if an app tries to use that method where the Service will be restricted
  • 35.
  • 36.
  • 37.
    Font Family <?xml version="1.0"encoding="utf-8"?> <font-family xmlns:android="http://schemas.android.com/apk/res/android">     <font         android:fontStyle="normal"         android:fontWeight="400"         android:font=“@font/lobster_regular" />     <font         android:fontStyle="italic"         android:fontWeight="400"         android:font=“@font/lobster_italic" /> </font-family>
  • 38.
    Adding fonts toa TextView <TextView         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:fontFamily="@font/lobster"/> <style name=“TextAppearance.CustomFont” parent="@android:style/TextAppearance.Small">     <item name="android:fontFamily">@font/lobster</item> </style> Typeface typeface = getResources().getFont(R.font.lobster); textView.setTypeface(typeface);
  • 39.
  • 40.
  • 41.
    New launcher iconsrules • Both layers must be sized at 108 × 108 dp • The inner 72 × 72 dp of the icon appears within the masked viewport • Outer 36 dp on each sides reserved for visual effectes
  • 42.
    Adaptive icon sample <maskable-icon>    <background android:drawable="@color/ic_background"/>     <foreground android:drawable="@mipmap/ic_foreground"/> </maskable-icon>
  • 43.
  • 44.
    Autosizing TextView • Granularity
 Choosethe best text size based on available space in range on minimum & maximum sizes & a dimension that specifies the size of step • Preset Sizes
 Choose the best text size from predefined sizes
  • 45.
    Granularity Autosizing <TextView   android:layout_width="wrap_content"  android:layout_height="wrap_content"   android:autoSizeText="uniform"   android:autoSizeMinTextSize="12sp"   android:autoSizeMaxTextSize="100sp"   android:autoSizeStepGranularity="2sp" />
  • 46.
    Preset Sizes Autosizing <resources>    <array name="autosize_text_sizes">         <item>10sp</item>         <item>12sp</item>         <item>20sp</item>         <item>40sp</item>         <item>100sp</item>     </array> </resources> <TextView   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:autoSizeText="uniform"   android:autoSizePresetSizes= "@array/autosize_text_sizes" />
  • 47.
  • 48.
  • 49.
    Pinning shortcuts ShortcutManager shortcutManager= context.getSystemService(ShortcutManager.class); if (shortcutManager.isRequestPinShortcutSupported()) {     ShortcutInfo pinShortcutInfo = new ShortcutInfo.Builder(context, “my-shortcut”) .setShortLabel(“Sample”) .setIntent(new Intent(“open_from_pinned_shortcut”)) .build();     shortcutManager.requestPinShortcut(pinShortcutInfo, null); }
  • 50.
    Pinning Shortcuts requirements •Default launcher must support pinning shortcuts • When you attempt to pin a shortcut onto launcher, the user receives a confirmation dialog asking their permission to pin the shortcut • ShortcutInfo requires short label & intent (or target Activity) • You can also pin App Widgets onto the launcher
  • 51.
  • 52.
    Java 8 Date& Time • Separated Date & Times classes • Duration & Period classes • Immutable • Thread-safe *You can user backport of Java 8 Date & Time - ThreeTen
  • 53.
    Java 7/8 NIOAPI • Path • Stream API for files • Work with file system info • WatchService
  • 54.
    Other Java APIupdates • java.lang.invoke
 Dynamic language support provided directly be the Java core class libraries & VM • java.util.Collections • Collections.sort() is implemented on top of List.sort() • Added checked, empty, synchronised & unmodifiable wrapper method for NavigableMap & NavigableSet
  • 55.
  • 56.
    Fragments • Postpone Fragmententer transition
 FragmentTransaction.postOnCommit(Runnable) • Fragment lifecycle callback • Primary Fragment • Optimizations for FragmentTransactions
  • 57.
    Permissions • The apptargeting Android O granted permissions it has explicitly requested.
 Once the user grants a permission to the app, all request for permissions in that permission group are automatically granted • Added android.permission.ANSWER_PHONE_CALLS
 Allows apps to answer incoming phone calls
 This is dangerous permission
 Part of PHONE permission group
  • 58.
    Cached data • StorageManager.getCacheQuotaBytes()
 Getdisk space quota for cached data for the app • New per-directory control how the system frees up cached data • StorageManager.setCacheBehaviorAtomic()
 All file in directory must be removed together • StorageManager.setCacheBehaviorTombstone()
 Do not delete files. Instead they should be truncated to be 0 bytes in length, leaving the empty file intact • Allocate disk space for files using StorageManager.allocateBytes()
 It will automatically trigger clear cached files of the app & other apps (as needed) to meet you request • Use StorageManager.getAllocatableBytes() instead of using File.getUsableSpace() for check is the device has enough disk space to hold new data
 It will consider any cached data the system is willing to clear on your behalf
  • 59.
    Content Provider • Newquery method with selection & sort params in queryArgs Bundle • Explicit refresh of content identified by URI
 Use refresh(Uri, Bundle, CancelationSignal) • Query pagination • Content Provider usage stats change for all apps
 Query for usage data of Contact provider now return approximations rather then exact values for TIMES_CONTACTED, TIMES_USED, LAST_TIME_CONTACTED, LAST_TIME_USED • Behavior changes of ContentResolver.notifyChange() & ContentResolver.registerContentObserver()
 Require a valid ContentProvider for the authority in all URIs
  • 60.
    Content Provider Paging //Create bundle with queryArgs Bundle queryArgs = new Bundle(4); queryArgs.putString( ContentResolver.QUERY_ARG_SQL_SELECTION, …); queryArgs.putStringArrayList( ContentResolver.QUERY_ARG_SQL_SELECTION_ARGS, …); queryArgs.putInt(ContentResolver.QUERY_ARG_OFFSET, 0); queryArgs.putInt(ContentResolver.QUERY_ARG_LIMIT, 100); Uri contentUri = …; context.getContentResolver().query(contentUri, queryArgs, null);
  • 61.
    Multi-display support • Enhancedsupport for multiple displays • User can move the Activity from one display to another
 If an activity supports multi-window mode. • System resizes the Activity and issues runtime changes as necessary, when an Activity is moved between displays • ActivityOptions contains new methods for control display the Activity launch
  • 62.
    WebView APIs • MultiprocessWebView
 Web content is handled in a separate, isolated process from the containing app’s process • Version API
 Fetching information of app displaying web content in you app • Google SafeBrowsing API
 Verify URLs. using Google Safe Browsing • Termination Handle API
 Handling situations when system kills renderer process of WebView • Renderer Importance API
 Set a priority policy for the renderer assigned to a particular WebView
  • 63.
    Strict mode • detectUnbufferedIo()
 Detectwhen app access to data without buffering • detectContentUriWithoutPermission()
 Detect when app accidentally forgets to grant permissions to another app when starting an Activity outside your app • detectUntaggedSockets()
 Detect when your app performs network traffics without using set TrafficStats.setThreadStateTag() to tag your traffic for debugging purposes
  • 64.
    App categories • Useto cluster together apps of similar purpose when presenting them to users, such as in Data Usage or Battery Usage • Set android:appCategory attribute in your <application> manifest tag • Categories: audio, game, image, maps, news, productivity, social, video
  • 65.
    AccountManager API • Controlof visibility of accounts for other applications • Now you can listen accounts updates only for specified account types • Apps can no longer get access to user accounts unless the authenticator owns the accounts or the user grants that access. 
 The GET_ACCOUNTS permission is no longer sufficient. Use AccountManager.newChooseAccountIntent() to grant access. • LOGIN_ACCOUNTS_CHANGED_ACTIONS is deprecated
 Use AccountManager.addOnAccountsUpdatedListener() during runtime
  • 66.
    Smart sharing Intent intent= new Intent(Intent.ACTION_CHOOSER); ArrayList<String> annotations = new ArrayList<>(3); annotations.add("person"); annotations.add("selfie"); annotations.add("child"); intent.putStringArrayListExtra(     Intent.EXTRA_CONTENT_ANNOTATIONS, annotations);
  • 67.
    Alert windows changes Appthat uses the SYSTEM_ALERT_WINDOW permission & use one of the following window types to display alert windows: • TYPE_PHONE • TYPE_PRIORITY_PHONE • TYPE_SYSTEM_ALERT • TYPE_SYSTEM_OVERLAY • TYPE_SYSTEM_ERROR
  • 68.
    Alert windows changes •For apps that not target Android O, it will be displayed beneath the windows, that use the TYPE_APPLICATION_OVERLAY window type. • Apps that target Android O can no longer use that window types to display alert windows above other apps & system windows. Instead, use new window type called TYPE_APPLICATION_OVERLAY
  • 69.
    Other updates • View.findViewById()& View.findViewByTag() now return generic type
 No need cast anymore. Activity.findViewById() not changed • View Tooltip
  • 70.
  • 71.
    Other updates • View.findViewById()& View.findViewByTag() now return generic type
 No need cast anymore. Activity.findViewById() not changed • View Tooltip • JobInfo transient extras • AnimatorSet seeking & reverse playing • Update Android ICU to version 58 • Settings.Secure.ANDROID_ID is unique for each app & user • SSLv3 no longer supported
  • 72.
    Other updates • Build.SERIALis deprecated. Use Build.getSerial() instead.
 Build.getSerial() requires READ_PHONE_STATE permission • android.app.ProgressDialog is deprecated • Color mode in Configuration
  • 73.
    Other Features • AutofillFramework • Picture-in-Picture for all • Color management • Wi-Fi Aware • Companion device pairing • Accessibility updates • Media enhancements
  • 74.
    Program overview DP1 -alpha DP2 - beta (Google I/O 2017?) DP3 - Final APIs & SDK, Play publishing
 DP4 - pre-final images
  • 75.
    Try Android ODeveloper Preview 1. Install Android Studio 2.4
 Use different Android SDK with stable Android 2.3 2. Download: 1. SDK & tools 2. Emulator image 3. Support libraries 3. Run emulator
 Emulator only work if you ANDROID_SDK & ANDROID_SDK_ROOT environment for Android SDK from Android Studio 2.4 
 Use emulator tools from canary Android SDK for work with emulator
  • 76.
    More about AndroidO on
 d.android.com/preview