13. 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
Test!
20. 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
28. 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
30. Assistant Support
New APIs to provide the assistant with relevant data
See SDK docs:
Activity.onProvideAssistData(Bundle)
Application.OnProvideAssistDataListener
44. Icons in Notifications
Icon ic = Icon.createWithResource(context,
R.drawable.ic_notification);
Notification no = Notification.Builder(context)
.setSmallIcon(ic)
...
.build();
45. Icons in Notifications
Icon ic = Icon.createWithBitmap(iconBitmap);
Notification no = Notification.Builder(context)
.setSmallIcon(ic)
...
.build();
53. 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
54. <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
55. 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
60. 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
61. 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
63. RenderScript Compute
BLAS intrinsics
(Really big matrices)
Allocation-less launches
Size of kernel separate from data
ScriptGroup
More dependency types
Better compiler optimizations
64. 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) {}
}
66. MIDI
Your could already do this…
… but it was a lot of work
Introducing … android.media.midi
MidiDeviceManager
MidiInputPort
MidiOutputPort
MidiDeviceService
67. High Resolution Audio
Audio samples: single-precision float
Sample rate: 96 kHz
USB digital audio: multichannel
71. Systrace
ListView item recycling involved inflating views. Ensure
Your Adapter#getView() recycles the incoming View,
Instead of constructing a new one.
77. So what are you waiting for?
Preview: d.android.com/preview
SDK + Android Studio: d.android.com/sdk
System image: d.android.com/sdk
Report bugs: code.google.com/android-developer-preview
DevBytes: youtube.com/GoogleDevelopers