Post on 15-Apr-2017
What’s new in Android M?
Top 10 things you should know
M - preview timeline
● Schedule subject to change● Updates delivered over-the-air (OTA)● Final M release targeting Q3 2015 (new Nexus 5?)
App permissions● NORMAL Permission vs Not :)● Changes to runtime permission● Reduced install and update
friction.● Behavior remains same for prev
versions of SDK○ grant upfront○ but can deny later
● Best practice : for absolutely necessary permission ask user for it during setup
App permissionstargetSdkVersion < M targetSdkVersion = M+
Pre-M device Install time permission dialog All permissions granted
M deviceInstall time permission dialog All permissions
grantedUser can revoke
permissions
No dialog during installNo permissions granted initially App can request
permissions User can revoke permissions
How to request permissions
And take care of the answer
Fingerprint API● New fingerprint api● Hardware support● Updated lockscreen● Multi finger support● UI is completely controlled by the app● Can fall back to keyguard manager● Authenticate user without sharing any credential
Doze Mode
Doze Mode● Better battery back up when idle● Standby can improve upto 2x● Uses sensors to detect if the phone is idle● Postpones non important tasks that wake up the device● Resumes when the device is moves
Doze Mode - What does it mean?
Network access is disabled, unless your app receives a high priority Google Cloud Messaging tickle.
Wake locks are ignored.Alarms scheduled with the AlarmManager class are disabled,
except for alarms that you've set with the setAlarmClock() method and AlarmManager.setAndAllowWhileIdle().
WiFi scans are not performed.Syncs and jobs for your sync adapters and JobScheduler are
not permitted to run.
App Standby● Apps that are not used for long
periods● Lose access to network and
background tasks● Avoid continuous battery drain for
unused stuff● Resumes when the device plugs in
or you use the app .
Assistant support● Provide system additional info about the current screen
○ Context○ Metadata
● can be at application or activity level .● Google Now on TAP
Data binding● Support library back to 2.1● view to object mapping● can apply transformation● better performance
activity_main.xml
User.java
MainActivity.java
Material design support library● Super useful● Lots of boilerplate code removed; no need to add multiple
libraries● Add to project
compile 'com.android.support:design:22.2.0'
● Navigation view , Floating Labels, SnackBar, Tabs , CoordinatorLayout , FAB
● check out coordinator layout animations on scroll
Navigation Drawer
Floating labels
FAB
Snackbar
Tabs
CoordinatorLayout
ApplinksDirectly open links in app without intent chooser● Create http://<domain>:<optional port>/.well-known/statements.json:
[{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "<package name>", "sha256_cert_fingerprints": ["6C:EC:C5:0E:34:AE....EB:0C:9B"] }}]
● Request app link verification<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="www.android.com" /> <data android:scheme="https" android:host="www.android.com" /> </intent-filter></activity>
Applinks● Request app link verification
<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="www.gett.com" /> <data android:scheme="https" android:host="www.gett.com" /> </intent-filter></activity>
Direct Share