SlideShare a Scribd company logo
1 of 76
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

More Related Content

What's hot

Anton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightAnton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightMichael Pustovit
 
Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2DreamLab
 
Converting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesConverting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesKaniska Mandal
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App EngineIndicThreads
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo Ali Parmaksiz
 
Easy REST APIs with Jersey and RestyGWT
Easy REST APIs with Jersey and RestyGWTEasy REST APIs with Jersey and RestyGWT
Easy REST APIs with Jersey and RestyGWTDavid Chandler
 
Data binding в массы! (1.2)
Data binding в массы! (1.2)Data binding в массы! (1.2)
Data binding в массы! (1.2)Yurii Kotov
 
Test and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppTest and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppMichele Capra
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in reactBOSC Tech Labs
 
That’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your BatteryThat’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your BatteryMichael Galpin
 
Developing application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDDDeveloping application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDDMichele Capra
 
OSGi and Eclipse RCP
OSGi and Eclipse RCPOSGi and Eclipse RCP
OSGi and Eclipse RCPEric Jain
 
Testing Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJavaTesting Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJavaFabio Collini
 

What's hot (20)

Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
 
Anton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightAnton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 light
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
 
Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2
 
Rxjs marble-testing
Rxjs marble-testingRxjs marble-testing
Rxjs marble-testing
 
Converting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesConverting Db Schema Into Uml Classes
Converting Db Schema Into Uml Classes
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App Engine
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
 
Easy REST APIs with Jersey and RestyGWT
Easy REST APIs with Jersey and RestyGWTEasy REST APIs with Jersey and RestyGWT
Easy REST APIs with Jersey and RestyGWT
 
Data binding в массы! (1.2)
Data binding в массы! (1.2)Data binding в массы! (1.2)
Data binding в массы! (1.2)
 
Test and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppTest and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 App
 
Open sourcing the store
Open sourcing the storeOpen sourcing the store
Open sourcing the store
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in react
 
That’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your BatteryThat’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your Battery
 
Rxjs vienna
Rxjs viennaRxjs vienna
Rxjs vienna
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
Developing application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDDDeveloping application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDD
 
OSGi and Eclipse RCP
OSGi and Eclipse RCPOSGi and Eclipse RCP
OSGi and Eclipse RCP
 
Testing Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJavaTesting Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJava
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 

Similar to What's new in Android O

Getting your app ready for android n
Getting your app ready for android nGetting your app ready for android n
Getting your app ready for android nSercan Yusuf
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...Ted Chien
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 seriesopenbala
 
MD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptMD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptbharatt7
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedToru Wonyoung Choi
 
Desenvolver para Chromecast
Desenvolver para ChromecastDesenvolver para Chromecast
Desenvolver para ChromecastPedro Veloso
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsHassan Abid
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)David Gibbons
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxKNANTHINIMCA
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgetsPrajyot Mainkar
 
Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Tomáš Kypta
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
 
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsUsing Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsLuis Cruz
 
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...NLJUG
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development PracticesRoy Clarkson
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfAbdullahMunir32
 

Similar to What's new in Android O (20)

Getting your app ready for android n
Getting your app ready for android nGetting your app ready for android n
Getting your app ready for android n
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
 
Modern android development
Modern android developmentModern android development
Modern android development
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
 
MD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptMD-IV-CH-ppt.ppt
MD-IV-CH-ppt.ppt
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
Desenvolver para Chromecast
Desenvolver para ChromecastDesenvolver para Chromecast
Desenvolver para Chromecast
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptx
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgets
 
Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA Austria
 
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsUsing Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
 
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdf
 

More from Kirill Rozov

Kotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKirill Rozov
 
2 years without Java. Kotlin only
2 years without Java. Kotlin only2 years without Java. Kotlin only
2 years without Java. Kotlin onlyKirill Rozov
 
Почему Kotlin?
Почему Kotlin?Почему Kotlin?
Почему Kotlin?Kirill Rozov
 
KOIN for dependency Injection
KOIN for dependency InjectionKOIN for dependency Injection
KOIN for dependency InjectionKirill Rozov
 
ConstraintLayout. Fell the Power of constraints
ConstraintLayout. Fell the Power of constraintsConstraintLayout. Fell the Power of constraints
ConstraintLayout. Fell the Power of constraintsKirill Rozov
 
Kotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platformsKotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platformsKirill Rozov
 
Kotlin - следующий язык после Java
Kotlin - следующий язык после JavaKotlin - следующий язык после Java
Kotlin - следующий язык после JavaKirill Rozov
 
Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3Kirill Rozov
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kirill Rozov
 
Что нового в Android O (Grodno HTP)
Что нового в Android O (Grodno HTP)Что нового в Android O (Grodno HTP)
Что нового в Android O (Grodno HTP)Kirill Rozov
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle IntroductionKirill Rozov
 
Kotlin для Android
Kotlin для AndroidKotlin для Android
Kotlin для AndroidKirill Rozov
 
What's new in Android M
What's new in Android MWhat's new in Android M
What's new in Android MKirill Rozov
 
Android Data Binding
Android Data BindingAndroid Data Binding
Android Data BindingKirill Rozov
 

More from Kirill Rozov (19)

Kotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is coming
 
2 years without Java. Kotlin only
2 years without Java. Kotlin only2 years without Java. Kotlin only
2 years without Java. Kotlin only
 
Почему Kotlin?
Почему Kotlin?Почему Kotlin?
Почему Kotlin?
 
KOIN for dependency Injection
KOIN for dependency InjectionKOIN for dependency Injection
KOIN for dependency Injection
 
Optimize APK size
Optimize APK sizeOptimize APK size
Optimize APK size
 
ConstraintLayout. Fell the Power of constraints
ConstraintLayout. Fell the Power of constraintsConstraintLayout. Fell the Power of constraints
ConstraintLayout. Fell the Power of constraints
 
Kotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platformsKotlin 1.2: Sharing code between platforms
Kotlin 1.2: Sharing code between platforms
 
Kotlin - следующий язык после Java
Kotlin - следующий язык после JavaKotlin - следующий язык после Java
Kotlin - следующий язык после Java
 
Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3Kotlin Advanced - Apalon Kotlin Sprint Part 3
Kotlin Advanced - Apalon Kotlin Sprint Part 3
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2
 
Что нового в Android O (Grodno HTP)
Что нового в Android O (Grodno HTP)Что нового в Android O (Grodno HTP)
Что нового в Android O (Grodno HTP)
 
Android service
Android serviceAndroid service
Android service
 
Effective Java
Effective JavaEffective Java
Effective Java
 
Dagger 2
Dagger 2Dagger 2
Dagger 2
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
REST
RESTREST
REST
 
Kotlin для Android
Kotlin для AndroidKotlin для Android
Kotlin для Android
 
What's new in Android M
What's new in Android MWhat's new in Android M
What's new in Android M
 
Android Data Binding
Android Data BindingAndroid Data Binding
Android Data Binding
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 

Recently uploaded (7)

CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 

What's new in Android O

  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 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 black text 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.
  • 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 • 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
  • 30. 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
  • 31. 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
  • 32. How app must work 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
  • 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 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);
  • 41. 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
  • 42. Adaptive icon sample <maskable-icon>     <background android:drawable="@color/ic_background"/>     <foreground android:drawable="@mipmap/ic_foreground"/> </maskable-icon>
  • 44. 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
  • 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" />
  • 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
  • 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 NIO API • Path • Stream API for files • Work with file system info • WatchService
  • 54. 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
  • 56. Fragments • Postpone Fragment enter transition
 FragmentTransaction.postOnCommit(Runnable) • Fragment lifecycle callback • Primary Fragment • Optimizations for FragmentTransactions
  • 57. 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
  • 58. 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
  • 59. 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
  • 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 • 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
  • 62. 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
  • 63. 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
  • 64. 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
  • 65. 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
  • 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 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
  • 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
  • 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.SERIAL is deprecated. Use Build.getSerial() instead.
 Build.getSerial() requires READ_PHONE_STATE permission • android.app.ProgressDialog is deprecated • Color mode in Configuration
  • 73. Other Features • Autofill Framework • 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 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
  • 76. More about Android O on
 d.android.com/preview