SlideShare a Scribd company logo
What’s New in Android
+Adam Koch
+Ankur Kotwal
Agenda
Android M Release
Google Play Services v7.8
Android Tools & Libraries
Android M
Android M…?
Android
Marshmallow
Available now for Nexus 5/6/9, Player & emulator
developer.android.com/preview
Get your apps ready!
Provide feedback and report bugs
Issue tracker: goo.gl/zcjEj7
Google+ community: goo.gl/BIq1eJ
Android M Developer Preview
On August 17 we released:
- Developer Preview 3 ROMs
- Final Android 6.0 (Marshmallow) SDK
Start publishing to Play today!
M Preview Timeline You are here
Getting Started with Marshmallow
android {
compileSdkVersion 23
buildToolsVersion '23.0.0'
defaultConfig {
applicationId 'com.google.samples.apps.mpreviewtest'
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName '1.0'
}
}
Runtime permissions!
Auto Backup
Power-Saving Optimizations
Other behavior changes:
- Adoptable Storage Devices
- AndroidHttpClient -> HttpUrlConnection
- OpenSSL -> BoringSSL
- And more: goo.gl/cf4lwy
Android M Behavior Changes
Why should you care?
- Significantly different behavior (after targeting M)
- No permission dialog on install --> less friction
- App updates --> automatic
- Fine grained, revocable permissions --> user feels in
control, improved user experience
Runtime Permissions
targetSdkVersion < M targetSdkVersion = M+
Pre-M device
Install time permission dialog
All permissions granted
M device
Install time permission dialog
All permissions granted
User can revoke permissions
No dialog during install
No permissions granted initially
App can request permissions
User can revoke permissions
Runtime Permissions
Runtime Permissions
Location
Camera
Microphone
Phone
All location permissions
Photo and video permissions
Audio recording
Phone state, dialing, etc.
SMS
Contacts
Calendar
Sensors
Storage
Controlling or reading SMS/MMS/etc.
Managing contacts
Managing calendars
Body sensors
Read, write external storage
Best Practices
Only ask for what you need, when you need it
Don’t overwhelm the user
Consider using system Intents if possible
Explain why you need permissions
Runtime Permissions
Context.checkSelfPermission(String permission)
Activity.requestPermissions(
String[] permissions, int requestCode)
Activity.onRequestPermissionsResult(
int requestCode, String[] permissions,
int[] grantResults)
New permissions methods
ContextCompat.checkSelfPermission(String permission)
ActivityCompat.requestPermissions(
String[] permissions, int requestCode)
ActivityCompat.onRequestPermissionsResult(
int requestCode, String[] permissions,
int[] grantResults)
*Also in Support Library (v23)
static final int LOCATION_PERMISSION_REQUEST_RESULT = 2;
...
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
requestPermissions(
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
LOCATION_PERMISSION_REQUEST_RESULT);
}
Requesting a permission
@Override
public void onRequestPermissionsResult(
int requestCode, String[] permissions, int[] grantResults) {
switch (requestCode) {
case LOCATION_PERMISSION_REQUEST_RESULT: {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// Granted!
} else {
// Denied!
}
}
}
}
Checking if permission was granted
If shouldShowRequestPermissionRationale()
returns true then show your own in-app UI
explaining why you need the permission.
When does it return true? If the user has denied the
permission in the past (but NOT checked “Don’t ask
again”).
Showing your own explaination
Free and automatic app data backup (and restore)
Up to 25MB per user per app
Occurs every 24 hours
Enabled for *all* apps running on M Preview (but for
M final only targetSdkVersion=M)
Auto Backup for Apps
Use platform APIs correctly, don’t hardcode paths:
getFilesDir(), getExternalFilesDir(), etc. will be backed up
getCacheDir(), getExternalCacheDir(), etc. will not be backed up
Exclude device-specific identifiers from backup
(eg. GCM registration ID, etc.)
Auto Backup for Apps
Configuring Auto Backup
AndroidManifest.xml
<application ...
android:fullBackupContent="@xml/mybackupscheme" />
xml/mybackupscheme.xml
<full-backup-content>
<include domain=["file"|"database"|"sharedpref"|"external"|"root"] path="string" />
<exclude domain=["file"|"database"|"sharedpref"|"external"|"root"] path="string" />
</full-backup-content>
# enable logging
$ adb shell setprop log.tag.BackupXmlParserLogging VERBOSE
# initialize Backup Manager
$ adb shell bmgr run
# trigger backup or restore
$ adb shell bmgr fullbackup <PACKAGE>
$ adb shell bmgr restore <PACKAGE>
Testing Auto Backup
Doze
increase standby time of devices
that aren’t being used
App Standby
reduce overhead of apps that are
installed but not used recently
Power-Saving Optimizations
flickr/trophygeek
Network access disabled (except high priority GCM)
Wake locks are ignored except for alarms set with setAlarmClock()
and setAndAllowWhileIdle()
Syncs and JobScheduler tasks are not allowed to run
Test with:
Doze
$ adb shell dumpsys battery unplug
$ adb shell dumpsys deviceidle step
$ adb shell dumpsys deviceidle -h
Apps considered idle unless:
- explicitly launched by user
- has a foreground process
- visible notification
- user asks for the app to be exempt
Idle apps are restricted:
- network access disabled
- syncs and background jobs suspended
App Standby
Android M New Platform Features
Direct Share
Fingerprint API & Confirm Credentials
Voice Interactions & Assist API
App Linking
Text Selection
And much more:
- Bluetooth Stylus, 4K Display, MIDI, Camera,
Android for Work...
Other Smaller Additions
Other Small Additions
After:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:foreground="@drawable/selector">
...
</LinearLayout>
Before:
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:foreground="@drawable/selector">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
...
</LinearLayout>
</FrameLayout>
Other Small Additions
Notifications
New android.graphics.drawable.Icon,
- Icon.createWithBitmap(Bitmap) for dynamic icons
Notification.Builder.setSmall/LargeIcon(Icon)
getActiveNotifications()
And lots more...
Fingerprint API & Confirm Credentials
Voice Interactions & Assist API
App Linking
Text Selection
Bluetooth Stylus
4K Display
MIDI
Camera
Android for Work…
Google Play
Services v7.8
Nearby Messages
Find nearby devices or beacons and
share messages
Cross platform support
Android & iOS
Unauthenticated
(Does not require a Google account)
Uses a variety of tech under the hood
Bluetooth, Bluetooth Low Energy, Wi-Fi and an
ultrasonic modem
Face API & Barcode API
Mobile Vision API
Smart Lock for Passwords
Credentials API
● auth.credentials.save
● auth.credentials.request
com.google.android.gms.auth.api.c
redentials.CredentialsApi
Creates a unique ID per app per install
Generate security tokens for services (suited for user by GCM)
Verify app authenticity & check if app install is active via web API
InstanceID
// Get InstanceID
String iid = InstanceID.getInstance().getID();
Topic based subscriptions
New base classes for receiving GCM messages
GCM Network Manager
Google Cloud Messaging
GCM Network Manager
GcmNetworkManager JobScheduler
Run during specific
time window
Supported
(one off, periodic)
Supported
(one off, periodic)
Require device charging Supported Supported
Specify network type Supported Supported
Require device idle Not Supported Supported
Execute by deadline Not Supported Supported
Android Tools
& Libraries
C/C++ support (coming soon)
- integrated debugging,
code completion, refactoring
Debugger improvements
Separate unit testing module
Speed improvements
Visual theme editor, layout editor improvements
Android Studio
Android Studio
Drawable Resources
Bitmap Vector
compile 'com.android.support:design:23.0.0'
Android Design Support Library
Floating labels for hint and error text
Built-in animations
Wrap EditText in a TextInputLayout
TextInputLayout
Providing lightweight quick feedback to your users
Snackbar
.make(parentLayout, “My Text”, Snackbar.LENGTH_LONG)
.setAction(“My Action”, myOnClickListener)
.show(); //Don’t forget to show!
Snackbar
Top level navigation or grouping content
tabGravity = center, fill
tabMode = scrollable, fixed
TabLayout
● Component to create view inside
Navigation Drawer
● Used with DrawerLayout
● Load items from menu resources
NavigationView
Built-in component for FAB, follows
design spec
Default color = ?attr/colorAccent
fabSize = full, mini
Floating Action Button (FAB)
Provide additional level of control between child
views
Coordinate different Views
- FloatingActionButton
- Snackbar
- Toolbar, Tabs
Each View sets own behavior
- CoordinatorLayout.Behavior
CoordinatorLayout
compile 'com.android.support:percent:23.0.0'
Managing percent based dimensions
<android.support.percent.PercentFrameLayout ...>
<ImageView app:layout_widthPercent="50%"
app:layout_heightPercent="50%"
app:layout_marginTopPercent="25%"
app:layout_marginLeftPercent="25%"/>
</android.support.percent.PercentFrameLayout>
Percent Support Library
Placing a FAB - Before
private void addFloatingActionButton() {
final int fabSize =
getResources().getDimensionPixelSize(R.dimen.fab_size);
int bottomOfQuestionView =
findViewById(R.id.question_view).getBottom();
final LayoutParams fabLayoutParams =
new LayoutParams(fabSize, fabSize, Gravity.END | Gravity.TOP);
final int fabPadding =
getResources().getDimensionPixelSize(R.dimen.padding_fab);
final int halfAFab = fabSize / 2;
fabLayoutParams.setMargins(0, // left
bottomOfQuestionView - halfAFab, //top
0, // right
fabPadding); // bottom
addView(mSubmitAnswer, fabLayoutParams);
}
<android.support.design.widget.CoordinatorLayout ...>
<TextView android:id="@+id/textLayout" />
<android.support.design.widget.FloatingActionButton ...
android:src="@drawable/ic_action_map"
app:layout_anchor="@id/textLayout"
app:layout_anchorGravity="bottom|start" />
</android.support.design.widget.CoordinatorLayout>
Placing a FAB - After
Android Developer Blog Post
goo.gl/THH9OA
DevByte Video
goo.gl/0jhXFb
Cheesesquare Sample
github.com/chrisbanes/cheesesquare
Resources
Thank You!
Questions?
+Adam Koch +Ankur Kotwal

More Related Content

What's hot

Android cours
Android coursAndroid cours
Android cours
zakaria bentahar
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminar
Joemarie Amparo
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
Sittiphol Phanvilai
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
Gunjan Kumar
 
Android Development
Android DevelopmentAndroid Development
Android Development
John Mark ジョンマーク
 
Android studio 2.2 Tips and Tricks
Android studio 2.2 Tips and TricksAndroid studio 2.2 Tips and Tricks
Android studio 2.2 Tips and Tricks
Uptech
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)Ahsanul Karim
 
Support Design Library
Support Design LibrarySupport Design Library
Support Design Library
Taeho Kim
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
Édipo Souza
 
Geekcamp Android
Geekcamp AndroidGeekcamp Android
Geekcamp Android
Hean Hong Leong
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studio
Abdul Basit
 
Android architecture components
Android architecture components Android architecture components
Android architecture components
azzeddine chenine
 
Android studio 2.0: default project structure
Android studio 2.0: default project structureAndroid studio 2.0: default project structure
Android studio 2.0: default project structure
Vyara Georgieva
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better Performance
Elif Boncuk
 
Android architecture
Android architecture Android architecture
Android architecture
Trong-An Bui
 
Android N Highligts
Android N HighligtsAndroid N Highligts
Android N Highligts
Sercan Yusuf
 
Android session 2
Android session 2Android session 2
Android session 2
Ahesanali Suthar
 
Android session 3
Android session 3Android session 3
Android session 3
Ahesanali Suthar
 
Introduction to android coding
Introduction to android codingIntroduction to android coding
Introduction to android coding
Hari Krishna
 

What's hot (20)

Android cours
Android coursAndroid cours
Android cours
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminar
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Android studio 2.2 Tips and Tricks
Android studio 2.2 Tips and TricksAndroid studio 2.2 Tips and Tricks
Android studio 2.2 Tips and Tricks
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)
 
Support Design Library
Support Design LibrarySupport Design Library
Support Design Library
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
 
Geekcamp Android
Geekcamp AndroidGeekcamp Android
Geekcamp Android
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studio
 
Android architecture components
Android architecture components Android architecture components
Android architecture components
 
Android studio 2.0: default project structure
Android studio 2.0: default project structureAndroid studio 2.0: default project structure
Android studio 2.0: default project structure
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better Performance
 
Android architecture
Android architecture Android architecture
Android architecture
 
Android N Highligts
Android N HighligtsAndroid N Highligts
Android N Highligts
 
Android session 2
Android session 2Android session 2
Android session 2
 
Android
AndroidAndroid
Android
 
Android session 3
Android session 3Android session 3
Android session 3
 
Introduction to android coding
Introduction to android codingIntroduction to android coding
Introduction to android coding
 

Similar to What's new in android jakarta gdg (2015-08-26)

Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...99X Technology
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalNAVER D2
 
Google Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with ZabbixGoogle Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with Zabbix
Max Kuzkin
 
Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android developmentSynapseindiappsdevelopment
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
Bartosz Kosarzycki
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
guest1af57e
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
Robert Cooper
 
KSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxKSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptx
Nashet Ali
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
Lou Sacco
 
Android workshop
Android workshopAndroid workshop
Android workshop
Nikola Kapraljevic Nixa
 
Android tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.comAndroid tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.com
TIB Academy
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
Renaud Boulard
 
Eddystone beacons demo
Eddystone beacons demoEddystone beacons demo
Eddystone beacons demo
Angelo Rüggeberg
 
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
COMAQA.BY
 
Android tutorial ppt
Android tutorial pptAndroid tutorial ppt
Android tutorial pptRehna Renu
 
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
Sercan Yusuf
 
Gradle for Android Developers
Gradle for Android DevelopersGradle for Android Developers
Gradle for Android Developers
Josiah Renaudin
 
Hands on App Engine
Hands on App EngineHands on App Engine
Hands on App Engine
Simon Su
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
Matthew McCullough
 

Similar to What's new in android jakarta gdg (2015-08-26) (20)

Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Google Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with ZabbixGoogle Cloud Platform monitoring with Zabbix
Google Cloud Platform monitoring with Zabbix
 
Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android development
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
KSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxKSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptx
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Android tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.comAndroid tutorial for beginners-traininginbangalore.com
Android tutorial for beginners-traininginbangalore.com
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
 
Eddystone beacons demo
Eddystone beacons demoEddystone beacons demo
Eddystone beacons demo
 
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
 
Android tutorial ppt
Android tutorial pptAndroid tutorial ppt
Android tutorial ppt
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
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
 
Gradle for Android Developers
Gradle for Android DevelopersGradle for Android Developers
Gradle for Android Developers
 
Hands on App Engine
Hands on App EngineHands on App Engine
Hands on App Engine
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
 

More from Google

Pengenalan android ndk
Pengenalan android ndkPengenalan android ndk
Pengenalan android ndk
Google
 
Material design for android (Diggest)
Material design for android (Diggest)Material design for android (Diggest)
Material design for android (Diggest)
Google
 
Developer mengajar
Developer mengajarDeveloper mengajar
Developer mengajar
Google
 
Layout, listview, gridview, and adapter
Layout, listview, gridview, and adapterLayout, listview, gridview, and adapter
Layout, listview, gridview, and adapter
Google
 
Fundamental android application development
Fundamental android application developmentFundamental android application development
Fundamental android application development
Google
 
Android application development
Android application developmentAndroid application development
Android application development
Google
 
Local developer program
Local developer programLocal developer program
Local developer program
Google
 

More from Google (7)

Pengenalan android ndk
Pengenalan android ndkPengenalan android ndk
Pengenalan android ndk
 
Material design for android (Diggest)
Material design for android (Diggest)Material design for android (Diggest)
Material design for android (Diggest)
 
Developer mengajar
Developer mengajarDeveloper mengajar
Developer mengajar
 
Layout, listview, gridview, and adapter
Layout, listview, gridview, and adapterLayout, listview, gridview, and adapter
Layout, listview, gridview, and adapter
 
Fundamental android application development
Fundamental android application developmentFundamental android application development
Fundamental android application development
 
Android application development
Android application developmentAndroid application development
Android application development
 
Local developer program
Local developer programLocal developer program
Local developer program
 

Recently uploaded

一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
manasideore6
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
itech2017
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 

Recently uploaded (20)

一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 

What's new in android jakarta gdg (2015-08-26)

  • 1. What’s New in Android +Adam Koch +Ankur Kotwal
  • 2. Agenda Android M Release Google Play Services v7.8 Android Tools & Libraries
  • 5.
  • 7. Available now for Nexus 5/6/9, Player & emulator developer.android.com/preview Get your apps ready! Provide feedback and report bugs Issue tracker: goo.gl/zcjEj7 Google+ community: goo.gl/BIq1eJ Android M Developer Preview
  • 8. On August 17 we released: - Developer Preview 3 ROMs - Final Android 6.0 (Marshmallow) SDK Start publishing to Play today! M Preview Timeline You are here
  • 9. Getting Started with Marshmallow android { compileSdkVersion 23 buildToolsVersion '23.0.0' defaultConfig { applicationId 'com.google.samples.apps.mpreviewtest' minSdkVersion 23 targetSdkVersion 23 versionCode 1 versionName '1.0' } }
  • 10. Runtime permissions! Auto Backup Power-Saving Optimizations Other behavior changes: - Adoptable Storage Devices - AndroidHttpClient -> HttpUrlConnection - OpenSSL -> BoringSSL - And more: goo.gl/cf4lwy Android M Behavior Changes
  • 11. Why should you care? - Significantly different behavior (after targeting M) - No permission dialog on install --> less friction - App updates --> automatic - Fine grained, revocable permissions --> user feels in control, improved user experience Runtime Permissions
  • 12. targetSdkVersion < M targetSdkVersion = M+ Pre-M device Install time permission dialog All permissions granted M device Install time permission dialog All permissions granted User can revoke permissions No dialog during install No permissions granted initially App can request permissions User can revoke permissions Runtime Permissions
  • 13. Runtime Permissions Location Camera Microphone Phone All location permissions Photo and video permissions Audio recording Phone state, dialing, etc. SMS Contacts Calendar Sensors Storage Controlling or reading SMS/MMS/etc. Managing contacts Managing calendars Body sensors Read, write external storage
  • 14. Best Practices Only ask for what you need, when you need it Don’t overwhelm the user Consider using system Intents if possible Explain why you need permissions Runtime Permissions
  • 15.
  • 16.
  • 17. Context.checkSelfPermission(String permission) Activity.requestPermissions( String[] permissions, int requestCode) Activity.onRequestPermissionsResult( int requestCode, String[] permissions, int[] grantResults) New permissions methods ContextCompat.checkSelfPermission(String permission) ActivityCompat.requestPermissions( String[] permissions, int requestCode) ActivityCompat.onRequestPermissionsResult( int requestCode, String[] permissions, int[] grantResults) *Also in Support Library (v23)
  • 18. static final int LOCATION_PERMISSION_REQUEST_RESULT = 2; ... if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { requestPermissions( new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_RESULT); } Requesting a permission
  • 19. @Override public void onRequestPermissionsResult( int requestCode, String[] permissions, int[] grantResults) { switch (requestCode) { case LOCATION_PERMISSION_REQUEST_RESULT: { if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // Granted! } else { // Denied! } } } } Checking if permission was granted
  • 20. If shouldShowRequestPermissionRationale() returns true then show your own in-app UI explaining why you need the permission. When does it return true? If the user has denied the permission in the past (but NOT checked “Don’t ask again”). Showing your own explaination
  • 21. Free and automatic app data backup (and restore) Up to 25MB per user per app Occurs every 24 hours Enabled for *all* apps running on M Preview (but for M final only targetSdkVersion=M) Auto Backup for Apps
  • 22. Use platform APIs correctly, don’t hardcode paths: getFilesDir(), getExternalFilesDir(), etc. will be backed up getCacheDir(), getExternalCacheDir(), etc. will not be backed up Exclude device-specific identifiers from backup (eg. GCM registration ID, etc.) Auto Backup for Apps
  • 23. Configuring Auto Backup AndroidManifest.xml <application ... android:fullBackupContent="@xml/mybackupscheme" /> xml/mybackupscheme.xml <full-backup-content> <include domain=["file"|"database"|"sharedpref"|"external"|"root"] path="string" /> <exclude domain=["file"|"database"|"sharedpref"|"external"|"root"] path="string" /> </full-backup-content>
  • 24. # enable logging $ adb shell setprop log.tag.BackupXmlParserLogging VERBOSE # initialize Backup Manager $ adb shell bmgr run # trigger backup or restore $ adb shell bmgr fullbackup <PACKAGE> $ adb shell bmgr restore <PACKAGE> Testing Auto Backup
  • 25. Doze increase standby time of devices that aren’t being used App Standby reduce overhead of apps that are installed but not used recently Power-Saving Optimizations flickr/trophygeek
  • 26. Network access disabled (except high priority GCM) Wake locks are ignored except for alarms set with setAlarmClock() and setAndAllowWhileIdle() Syncs and JobScheduler tasks are not allowed to run Test with: Doze $ adb shell dumpsys battery unplug $ adb shell dumpsys deviceidle step $ adb shell dumpsys deviceidle -h
  • 27. Apps considered idle unless: - explicitly launched by user - has a foreground process - visible notification - user asks for the app to be exempt Idle apps are restricted: - network access disabled - syncs and background jobs suspended App Standby
  • 28. Android M New Platform Features Direct Share Fingerprint API & Confirm Credentials Voice Interactions & Assist API App Linking Text Selection And much more: - Bluetooth Stylus, 4K Display, MIDI, Camera, Android for Work...
  • 31. Other Small Additions Notifications New android.graphics.drawable.Icon, - Icon.createWithBitmap(Bitmap) for dynamic icons Notification.Builder.setSmall/LargeIcon(Icon) getActiveNotifications()
  • 32. And lots more... Fingerprint API & Confirm Credentials Voice Interactions & Assist API App Linking Text Selection Bluetooth Stylus 4K Display MIDI Camera Android for Work…
  • 34. Nearby Messages Find nearby devices or beacons and share messages Cross platform support Android & iOS Unauthenticated (Does not require a Google account) Uses a variety of tech under the hood Bluetooth, Bluetooth Low Energy, Wi-Fi and an ultrasonic modem
  • 35. Face API & Barcode API Mobile Vision API
  • 36. Smart Lock for Passwords Credentials API ● auth.credentials.save ● auth.credentials.request com.google.android.gms.auth.api.c redentials.CredentialsApi
  • 37. Creates a unique ID per app per install Generate security tokens for services (suited for user by GCM) Verify app authenticity & check if app install is active via web API InstanceID // Get InstanceID String iid = InstanceID.getInstance().getID();
  • 38. Topic based subscriptions New base classes for receiving GCM messages GCM Network Manager Google Cloud Messaging
  • 39. GCM Network Manager GcmNetworkManager JobScheduler Run during specific time window Supported (one off, periodic) Supported (one off, periodic) Require device charging Supported Supported Specify network type Supported Supported Require device idle Not Supported Supported Execute by deadline Not Supported Supported
  • 41. C/C++ support (coming soon) - integrated debugging, code completion, refactoring Debugger improvements Separate unit testing module Speed improvements Visual theme editor, layout editor improvements Android Studio
  • 45. Floating labels for hint and error text Built-in animations Wrap EditText in a TextInputLayout TextInputLayout
  • 46. Providing lightweight quick feedback to your users Snackbar .make(parentLayout, “My Text”, Snackbar.LENGTH_LONG) .setAction(“My Action”, myOnClickListener) .show(); //Don’t forget to show! Snackbar
  • 47. Top level navigation or grouping content tabGravity = center, fill tabMode = scrollable, fixed TabLayout
  • 48. ● Component to create view inside Navigation Drawer ● Used with DrawerLayout ● Load items from menu resources NavigationView
  • 49. Built-in component for FAB, follows design spec Default color = ?attr/colorAccent fabSize = full, mini Floating Action Button (FAB)
  • 50. Provide additional level of control between child views Coordinate different Views - FloatingActionButton - Snackbar - Toolbar, Tabs Each View sets own behavior - CoordinatorLayout.Behavior CoordinatorLayout
  • 51. compile 'com.android.support:percent:23.0.0' Managing percent based dimensions <android.support.percent.PercentFrameLayout ...> <ImageView app:layout_widthPercent="50%" app:layout_heightPercent="50%" app:layout_marginTopPercent="25%" app:layout_marginLeftPercent="25%"/> </android.support.percent.PercentFrameLayout> Percent Support Library
  • 52. Placing a FAB - Before private void addFloatingActionButton() { final int fabSize = getResources().getDimensionPixelSize(R.dimen.fab_size); int bottomOfQuestionView = findViewById(R.id.question_view).getBottom(); final LayoutParams fabLayoutParams = new LayoutParams(fabSize, fabSize, Gravity.END | Gravity.TOP); final int fabPadding = getResources().getDimensionPixelSize(R.dimen.padding_fab); final int halfAFab = fabSize / 2; fabLayoutParams.setMargins(0, // left bottomOfQuestionView - halfAFab, //top 0, // right fabPadding); // bottom addView(mSubmitAnswer, fabLayoutParams); }
  • 53. <android.support.design.widget.CoordinatorLayout ...> <TextView android:id="@+id/textLayout" /> <android.support.design.widget.FloatingActionButton ... android:src="@drawable/ic_action_map" app:layout_anchor="@id/textLayout" app:layout_anchorGravity="bottom|start" /> </android.support.design.widget.CoordinatorLayout> Placing a FAB - After
  • 54. Android Developer Blog Post goo.gl/THH9OA DevByte Video goo.gl/0jhXFb Cheesesquare Sample github.com/chrisbanes/cheesesquare Resources