SlideShare a Scribd company logo
1 of 103
Download to read offline
What’s new in Android M
Building M Preview Apps
Android M is now available on SDK Manager
Building M Preview Apps
Previewssssss
OK. Let’s start.
Apps Permission
FASTER INSTALLS • SMOOTHER UPGRADES • MORE USER CONTROL
Install-time permissions
Runtime permissions in M
User controls in M
Everything you’ve ever asked for
But now your app has to deal with it
Apps targeting M can:
can ask for any permission at any time
Legacy apps will:
get all permissions at install time, as before
Users can:
deny any permissions upon request
deny any permissions at any later time – even legacy apps
Voice Interactions
Voice Interactions
VoiceInteractor – confirm and prompt for response
<activity android:name="org.example.MyVoiceActivity">
<intent-filter>
<action android:name="org.example.MY_ACTION_INTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
</activity>
Voice Interactions
public class MyVoiceActivity
extends AppCompatActivity {
@Override
protected void onResume() {
super.onResume();
if (isVoiceInteraction()) {
// do stuff
} else {
finish();
}
}
Voice Interactions
public class MyVoiceActivity
extends AppCompatActivity {
@Override
protected void onResume() {
super.onResume();
if (isVoiceInteraction()) {
String prompt = "...";
getVoiceInteractor().submitRequest(
new Confirm(prompt));
} else {
finish();
}
}
Voice Interactions
public class Confirm extends
VoiceInteractor.ConfirmationRequest {
public Confirm(String prompt) {
super(prompt, null);
}
@Override
public void onConfirmationResult(
boolean confirmed, Bundle result) {
if (confirmed) {
// do stuff
}
}
}
public class MyVoiceActivity
extends AppCompatActivity {
@Override
protected void onResume() {
super.onResume();
if (isVoiceInteraction()) {
String prompt = “Are you sure?";
getVoiceInteractor().submitRequest(
new Confirm(prompt));
} else {
finish();
}
}
Fingerprint
QUICK USER VERIFICATION
Two APIs for fingerprints
FingerprintManager.authenticate()
Verify that authorized user is present
Your app controls all UI
KeyguardManager.createConfirmDeviceCredentialIntent()
Present lock screen to user
startActivityForResult(), check for RESULT_OK
Sample code
github.com/googlesamples/android-FingerprintDialog
github.com/googlesamples/android-ConfirmCredential
Android Backup
RESTORATION SOFTWARE
Android Backup
All data now backed up by default
targetSdk M
Optional scheme file in xml/ resource dir
includes/excludes
Android Backup
AndroidManifest.xml
<application android:fullBackupContent="@xml/mybackupscheme">
...
</application>
res/xml/mybackupscheme.xml
<full-backup-content>
<exclude domain="database" path="device_info.db"/>
</full-backup-content>
or
<full-backup-content>
<include domain="file" path="mydata/allthatmatters.txt"/>
</full-backup-content>
Google Play Services
7.5 AND COUNTING
GCM Network Manager
Like JobScheduler
… but across releases
OneOffTask
PeriodicTask
Limit network requests to wifi, or charging, or …
Also…
Maps on Android Wear
App Invites
Cast Remote Display
Smart Lock for Passwords
…
Power
EVEN BETTER BATTERY LIFE
Power improvements
Better screen-off battery life
Doze
Untouched devices become “inactive”
Wait longer to wake up for background tasks
Resume normal operation when moved, used, or plugged in
App standby
Unused apps lose network access
Resume when launched/used or when plugged in
Assistant Support
CONTEXTUAL INFORMATION, WHEN THE USER NEEDS IT
Assistant Support
New APIs to provide the assistant with relevant data
See SDK docs:
Activity.onProvideAssistData(Bundle)
Application.OnProvideAssistDataListener
Data Binding
BOUNDS AND DETERMINED
Data Binding
Connecting data and UI elements
Automates listener creation, message sending, setters, …
Pre-processed at build time
Data Binding
<layout>
<data>
<variable name="item" type="com.android.example.store.Item"/>
</data>
<FrameLayout ...>
<ImageView ... android:src="@{item.image}" />
<TextView ... android:text="@{@string/price(item.dollars, item.cents)}" />
</FrameLayout>
</layout>
UI Features
ALL ABOUT YOU AND I
Android Design Support Library
Snackbar
Android Design Support Library
Snackbar
FAB
Android Design Support Library
Snackbar
FAB
CoordinatorLayout
Android Design Support Library
Snackbar
FAB
CoordinatorLayout
TabLayout
Android Design Support Library
Snackbar
FAB
CoordinatorLayout
TabLayout
TextInputLayout
Android Design Support Library
Snackbar
FAB
CoordinatorLayout
TabLayout
TextInputLayout
NavigationView
Other UI Changes
RecyclerView ItemTouchHelper
Swipe-to-dismiss
Drag & drop
Notifications
HEY! YOU THERE! LOOK UP HERE!
android.graphics.drawable.Icon
Holds either:
a drawable resource id
a Bitmap
a byte[] holding a PNG or JPEG
Icons in Notifications
Icon ic = Icon.createWithResource(context,
R.drawable.ic_notification);
Notification no = Notification.Builder(context)
.setSmallIcon(ic)
...
.build();
Icons in Notifications
Icon ic = Icon.createWithBitmap(iconBitmap);
Notification no = Notification.Builder(context)
.setSmallIcon(ic)
...
.build();
Text Stuffs
TEXT IS ALL AROUND
Text Selection
Easier Selection
Floating palette with action items
Default for TextView
Other views
set ActionMode.TYPE_FLOATING
App Links
RELATIONSHIP BETWEEN APP AND WEB DOMAINS
App Links
Understand the relationship
between an app and web domains
owned by the same developer
d.android.com/preview/features/app-linking.html
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": “com.example.myapp",
"sha256_cert_fingerprints": ["6C:EC:C5:0E:34:AE....EB:0C:9B"]
}
}]
http://example.com/.well-known/statements.json
https: for M final
keytool -list -v -keystore release.keystore
Establishing app links
At install time
Package Manager fetches statements.json
Matches hash to APK’s signing certificate
These links will now launch your app
On failure, a link is not created
Usual intent chooser will be shown
Users can review & modify app links
Settings -> Apps -> (Your App) -> Open by default
<activity ...>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host=“example.com" />
<data android:scheme="http" android:host="www.example.com" />
</intent-filter>
</activity>
AndroidManifest.xml
This is where we will look for /.well-known/statements.json
Establishing app links
At install time
Package Manager fetches statements.json
Matches hash to APK’s signing certificate
These links will now launch your app
On failure, a link is not created
Usual intent chooser will be shown
Users can review & modify app links
Settings -> Apps -> (Your App) -> Open by default
Direct Share
SHARING IS EVEN MORE AWESOME
Direct Share
<activity ...>
<intent-filter>
<action android:name="android.intent.action.SEND" />
</intent-filter>
<meta-data android:name="android.service.chooser.chooser_target_service"
android:value=".MyChooserTargetService" />
</activity>
<service android:name=".MyChooserTargetService"
android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
<intent-filter>
<action android:name="android.service.chooser.ChooserTargetService" />
</intent-filter>
</service>
public class MyChooserTargetService extends ChooserTargetService {
@Override
public List<ChooserTarget> onGetChooserTargets(ComponentName targetActivityName,
IntentFilter matchedFilter) {
// do stuff
}
}
Stylus support
NOW THE PRESSURE IS REALLY ON
Styluses: supported since
ICE_CREAM_SANDWICH
MotionEvent APIs:
TOOL_TYPE_STYLUS
BUTTON_SECONDARY
BUTTON_TERTIARY
getPressure(), getSize(), getOrientation(), etc.
Until now, this only worked for wired/builtin digitizers
Bluetooth stylus support
Want to make a Bluetooth stylus?
Report pressure and buttons using Bluetooth HID
Android M will fuse this with touch events
Result touch stream will be TOOL_TYPE_STYLUS
(or TOOL_TYPE_ERASER)
Bluetooth stylus support for every app and every M device
New stylus API in M
Button support
ACTION_BUTTON_PRESS, ACTION_BUTTON_RELEASE,
BUTTON_STYLUS_PRIMARY, BUTTON_STYLUS_SECONDARY
Gesture support
ScaleGestureDetector.setStylusScaleEnabled(bool)
Quick scale with button-click+drag
OnGestureListener.onStylusButtonPress
Use this for selection & drag-and-drop
Graphics & Media
IT’S ALL ABOUT THE PIXELS
RenderScript Compute
BLAS intrinsics
(Really big matrices)
Allocation-less launches
Size of kernel separate from data
ScriptGroup
More dependency types
Better compiler optimizations
Camera
New Torch mode
Independent of camera device
CameraManager.setTorchMode(String cameraId, boolean enabled);
public abstract class CameraManager.TorchCallback {
public void onTorchModeUnavailable(String cameraId) {}
public void onTorchModeChanged(String cameraId, boolean enabled) {}
}
MIDI
Your could already do this…
… but it was a lot of work
Introducing … android.media.midi
MidiDeviceManager
MidiInputPort
MidiOutputPort
MidiDeviceService
High Resolution Audio
Audio samples: single-precision float
Sample rate: 96 kHz
USB digital audio: multichannel
Tools
MAKE IT HAPPENS
Android Studio
Integrated testing support
Data binding
Vector drawables
New annotations
Android NDK
Systrace
Systrace
ListView item recycling involved inflating views. Ensure
Your Adapter#getView() recycles the incoming View,
Instead of constructing a new one.
ART
Compiler optimizations
register allocator
global value number
loop-invariant code motion
dead code elimination
bounds check elimination
constant folding
inlining
ART
Runtime stats
Debug.getRuntimeStat(String)
“art.gc.gc-count”
“art.gc.gc-time”
…
Thank you
Q&A

More Related Content

What's hot

2010 08-26-smart-architecture
2010 08-26-smart-architecture2010 08-26-smart-architecture
2010 08-26-smart-architecture
CHIP
 

What's hot (20)

Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
 
07.4. Android Basic Simple Browser (WebView)
07.4. Android Basic Simple Browser (WebView)07.4. Android Basic Simple Browser (WebView)
07.4. Android Basic Simple Browser (WebView)
 
Salesforce Lightning Data Services- Hands on Training
Salesforce Lightning Data Services- Hands on TrainingSalesforce Lightning Data Services- Hands on Training
Salesforce Lightning Data Services- Hands on Training
 
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
 
08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
7 Deadly Sins in Azure AD App Development
7 Deadly Sins in Azure AD App Development7 Deadly Sins in Azure AD App Development
7 Deadly Sins in Azure AD App Development
 
2010 08-26-smart-architecture
2010 08-26-smart-architecture2010 08-26-smart-architecture
2010 08-26-smart-architecture
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QA
 
Developing accessible android applications
Developing accessible android applicationsDeveloping accessible android applications
Developing accessible android applications
 
Case study on Movie Quiz App For IPhone and IPad – Facebook Enabled
Case study on Movie Quiz App For IPhone and IPad –  Facebook Enabled Case study on Movie Quiz App For IPhone and IPad –  Facebook Enabled
Case study on Movie Quiz App For IPhone and IPad – Facebook Enabled
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
4.preference management
4.preference management 4.preference management
4.preference management
 
Android in practice
Android in practiceAndroid in practice
Android in practice
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
 
12. Android Basic Google Map
12. Android Basic Google Map12. Android Basic Google Map
12. Android Basic Google Map
 
Google+ sign in for mobile & web apps
Google+ sign in for mobile & web appsGoogle+ sign in for mobile & web apps
Google+ sign in for mobile & web apps
 

Similar to Обзор Android M

Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
Anton Narusberg
 
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
AbdullahMunir32
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
sonichinmay
 

Similar to Обзор Android M (20)

I/O Rewind 215: What's new in Android
I/O Rewind 215: What's new in AndroidI/O Rewind 215: What's new in Android
I/O Rewind 215: What's new in Android
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 
Invading the home screen
Invading the home screenInvading the home screen
Invading the home screen
 
How to Setup App Indexation
How to Setup App IndexationHow to Setup App Indexation
How to Setup App Indexation
 
Deep linking
Deep linkingDeep linking
Deep linking
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
 
Lecture #1 Creating your first android project
Lecture #1  Creating your first android projectLecture #1  Creating your first android project
Lecture #1 Creating your first android project
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg...
 Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg... Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg...
Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg...
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Android N Highligts
Android N HighligtsAndroid N Highligts
Android N Highligts
 
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
 
App Deep Linking
App Deep LinkingApp Deep Linking
App Deep Linking
 
An Introduction to Deep Linking and App Indexing Codelab
An Introduction to Deep Linking and App Indexing CodelabAn Introduction to Deep Linking and App Indexing Codelab
An Introduction to Deep Linking and App Indexing Codelab
 
What's new in Android M
What's new in Android MWhat's new in Android M
What's new in Android M
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android Programming
 

More from WOX APP

More from WOX APP (20)

Кейс по разработке сервиса такси "7 Likes taxi"
Кейс по разработке сервиса такси "7 Likes taxi"Кейс по разработке сервиса такси "7 Likes taxi"
Кейс по разработке сервиса такси "7 Likes taxi"
 
Кейс _сервис знакомств Talkiss
Кейс _сервис знакомств Talkiss Кейс _сервис знакомств Talkiss
Кейс _сервис знакомств Talkiss
 
Google I/O 2016 для разработчиков
Google I/O 2016 для разработчиковGoogle I/O 2016 для разработчиков
Google I/O 2016 для разработчиков
 
Google I/O 2016
Google I/O 2016Google I/O 2016
Google I/O 2016
 
Android Navigation Patterns
Android Navigation PatternsAndroid Navigation Patterns
Android Navigation Patterns
 
iOS navigation
iOS navigationiOS navigation
iOS navigation
 
iOS UIKit
iOS UIKitiOS UIKit
iOS UIKit
 
Android Interface components
Android Interface componentsAndroid Interface components
Android Interface components
 
Кейс по разработке сервиса_SayMeWow (Android, iOS)
Кейс по разработке сервиса_SayMeWow (Android, iOS)Кейс по разработке сервиса_SayMeWow (Android, iOS)
Кейс по разработке сервиса_SayMeWow (Android, iOS)
 
Кейс по разработке веб-сервиса для ресторанов Еда-Сюда
Кейс по разработке  веб-сервиса для ресторанов Еда-СюдаКейс по разработке  веб-сервиса для ресторанов Еда-Сюда
Кейс по разработке веб-сервиса для ресторанов Еда-Сюда
 
Кейс по разработке сервиса для ресторанов Table pay (iPhone)
Кейс по разработке сервиса для ресторанов Table pay (iPhone)Кейс по разработке сервиса для ресторанов Table pay (iPhone)
Кейс по разработке сервиса для ресторанов Table pay (iPhone)
 
Кейс по разработке приложения для Sanwell (Android)
Кейс по разработке приложения для Sanwell (Android)Кейс по разработке приложения для Sanwell (Android)
Кейс по разработке приложения для Sanwell (Android)
 
Обзор iOS 9
Обзор iOS 9Обзор iOS 9
Обзор iOS 9
 
Разработка приложения Wi-fi Space (Android)
Разработка приложения Wi-fi Space (Android)Разработка приложения Wi-fi Space (Android)
Разработка приложения Wi-fi Space (Android)
 
Кейс по разработке приложения для hochu.ua (iPad)
Кейс по разработке приложения для hochu.ua (iPad)Кейс по разработке приложения для hochu.ua (iPad)
Кейс по разработке приложения для hochu.ua (iPad)
 
Кейс по разработке приложения для akusherstvo.ru (iPad)
Кейс по разработке приложения для akusherstvo.ru (iPad)Кейс по разработке приложения для akusherstvo.ru (iPad)
Кейс по разработке приложения для akusherstvo.ru (iPad)
 
Кейс по разработке приложения Marker Meter (iPhone)
Кейс по разработке приложения Marker Meter (iPhone)Кейс по разработке приложения Marker Meter (iPhone)
Кейс по разработке приложения Marker Meter (iPhone)
 
Кейс по разработке медицинского приложения Юрия-Фарм (IOS, Android)
Кейс по разработке медицинского приложения Юрия-Фарм (IOS, Android)Кейс по разработке медицинского приложения Юрия-Фарм (IOS, Android)
Кейс по разработке медицинского приложения Юрия-Фарм (IOS, Android)
 
Кейс по разработке приложения по GPS мониторингу (IOS)
Кейс по разработке приложения по GPS мониторингу (IOS)Кейс по разработке приложения по GPS мониторингу (IOS)
Кейс по разработке приложения по GPS мониторингу (IOS)
 
Кейс по разработке приложения для akusherstvo.ru (iPhone)
Кейс по разработке приложения для akusherstvo.ru (iPhone)Кейс по разработке приложения для akusherstvo.ru (iPhone)
Кейс по разработке приложения для akusherstvo.ru (iPhone)
 

Обзор Android M