Android 6 Essentials - Yossi Elkrief - E-Book

Android 6 Essentials E-Book

Yossi Elkrief

0,0
23,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Android 6 is the latest and greatest version of the Android operating system, and comes packed with cutting edge new features for you to harness for the benefit of building better applications.
This step-by-step guide will take you through the basics of the Android Marshmallow permissions model and beyond into other crucial areas such as the Audio,Video,Camera API and Android’s at work features. Learn how to create, deploy, and manage Android applications with Marshmallow’s API and the latest functionalities.
The combination of instructions and real-world examples will make your application deployment and testing a breeze.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 120

Veröffentlichungsjahr: 2015

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Android 6 Essentials
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Android Marshmallow Permissions
An overview of Android permissions
Permissions
Permission group definitions
Permissions that imply feature requirements
Viewing the permissions for each app
Understanding Android Marshmallow permissions
An overview
Permission groups
Runtime permissions
Taking coding permissions into account
Testing permissions
Coding for runtime permissions
Best practices and usage notes
Minimalism is a great option
Asking for too many permissions at once
Honesty can be a great policy
Need support handling runtime permissions?
Some permissions are normal and safer to use
Summary
2. App Links
The Android Intent system
Creating a website association
Why this file?
Triggering app link verification
App link settings and management
Testing app links
Checking manifest and listing domains
The Digital Asset Links API
Testing our intent
Checking policies using adb
Summary
3. Apps' Auto Backup
An overview
Data backup configuration
Including or excluding data
The backup configuration syntax
Opting out from app data backup
Backup configuration testing
Setting backup logs
Testing the backup phase
Testing the restore phase
Troubleshooting
Important bytes
What to exclude from the backup
BackupAgent and backup events
Summary
4. Changes Unfold
Power-saving modes
The Doze mode
What happens to apps when a device is dozing?
Testing apps with Doze mode
The App Standby mode
What happens to apps when in the App Standby mode?
Testing apps with the App Standby mode
Excluded apps and settings
Tips
Removable storage adoption
Apache HTTP client removal
Notifications
Text selection
Support library notice
Android Keystore changes
Wi-Fi and networking changes
Runtime
Hardware identifier
APK validation
USB connection
Direct Share
What if we have nothing to share?
Direct Share best practices
Voice interactions
The Assist API
Bluetooth API Changes
Bluetooth stylus support
Improved Bluetooth low energy scanning
Summary
5. Audio, Video, and Camera Features
Audio features
Support for the MIDI protocol
MidiManager
Digital audio capture and playback
Audio and input devices
Information on audio devices
Changes in AudioManager
Video features
android.media.MediaSync
MediaCodecInfo.CodecCapabilities.getMaxSupportedInstances
Why do we need to know this?
MediaPlayer.setPlaybackParams
Camera features
The flashlight API
The reprocessing API
android.media.ImageWriter
android.media.ImageReader
Changes in the camera service
Summary
6. Android for Work
Behavioral changes
The work profile contacts display option
Wi-Fi configuration options
The Wi-Fi configuration lock
Work Policy Controller addition
DevicePolicyManager changes
Single-use device improvements
Silently installing/uninstalling apps
Improved certificate access
Automatic system updates
Third-party certificate installation
Data usage statistics
Managing runtime permissions
VPN access and display
Work profile status
Summary
7. Chrome Custom Tabs
What is a Chrome custom tab?
What is WebView?
Customization options
When to use Chrome custom tabs
The implementation guide
Can we use Chrome custom tabs?
Custom UI and tab interaction
The custom action button
Configuring a custom menu
Configuring custom enter and exit animations
Chrome warm-up
Connecting to the Chrome service
Warming up the browser process
Creating a new tab session
Setting the prefetching URL
Custom tabs connection callback
Summary
8. Authentication
The Fingerprint authentication API
How do we use fingerprint authentication?
Setting up for testing
Credentials' Grace Period
Cleartext network traffic
So, what do we do with the cleartext network traffic flag?
Summary
Index

Android 6 Essentials

Android 6 Essentials

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: November 2015

Production reference: 1251115

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78588-441-2

www.packtpub.com

Credits

Author

Yossi Elkrief

Reviewer

Pavel Pavlasek

Commissioning Editor

Edward Gordon

Acquisition Editor

Reshma Raman

Content Development Editor

Riddhi Tuljapurkar

Technical Editor

Gaurav Suri

Copy Editor

Stuti Srivastava

Project Coordinator

Sanchita Mandal

Proofreader

Safis Editing

Indexer

Hemangini Bari

Graphics

Kirk D'Penha

Disha Haria

Abhinash Sahu

Production Coordinator

Aparna Bhagat

Cover Work

Aparna Bhagat

About the Author

Yossi Elkrief is an Android enthusiast with over 7 years of experience in the Android platform and is currently working as an Android architect and group leader at Tikal Knowledge.

Among his previous experiences, the noteworthy ones include ooVoo, Fiverr, Mobli, and Glide, reaching out to over 135 million users worldwide.

Yossi is a mentor at Google Launchpad, a lecturer on IoT and mobile development, and co-tech lead on the Madgera accelerator. He cofounded the GDG Be'er Sheva group and co-leads the group today, holding technology events for the technology community in Israel. He has a spouse and a daughter, and he lives in Be'er Sheva, Israel.

His main interests are Liverpool Football Club and his Android mini collectibles collection, with over 120 different pieces. You can find him on LinkedIn at https://il.linkedin.com/in/yossielkrief, on GitHub at MaTriXy, and on Google+ at Yossi.Elkrief.

Acknowledgments

First, I want to thank my family for their patience, love, and endurance with me taking yet another challenge, reducing the amount of time I can spend with them.

To Irit, my wife, for the constant love and support and remembering to feed me when I couldn't remember to feed myself.

To Mia, my daughter I love you.

To my mother and father, whom I love and cherish.

To my friends, for being there with their coding armor on and for giving me the chance to shine.

To my mentor, friend, and family, Israel Mali; thank you for guiding me for 15 years, helping me carve my career path. May you rest in peace.

I want to thank Packt Publishing for this opportunity and for publishing my first book. A special thanks to Riddhi Tuljapurkar for all the help and guidance.

Last but not least, I challenge you to try out the Chubby Bunny challenge at http://icebreakerideas.com/chubby-bunny-challenge/.

About the Reviewer

Pavel Pavlasek has been an Android developer for over 5 years, apart from being a long-time Java developer. He develops web information systems and Android applications, and he is passionate about new technologies.

I would like to thank to my family for their support and inspiration—my wife, Daniela, and my children, Michaela, Jakub, and Juraj. I would also like to thank my colleagues and other Android developers I've met.

www.PacktPub.com

Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

Preface

Android 6 will primarily focus on improving the overall user experience, and it will bring in a few features, such as a redesigned permission model in which applications are no longer automatically granted all of their specified permissions at the time of installation, the Doze power scheme for extended battery life when a device is not manipulated by the user, and native support for fingerprint recognition.

If you're already an Android developer, you're only a few steps away from being able to use your existing development experience to reach your users wherever or whenever they want or need your app.

As a professional Android developer, you have to create production-ready apps for your users. This book will give you what it takes to ship polished apps as part of a development team at a company, an independent app developer, or just as a programmer using Android development best practices.

By the end of the book, you'll be able to identify critical areas for improvement in an app and implement the necessary changes and refinements to ensure it meets Android's Core App Guidelines prior to shipping.

What this book covers

Chapter 1, Android Marshmallow Permissions, discusses how the Android permission system and model are vast and have made a few changes that can help app developers and applications gain more traction, installations, and give users the ability to decide when your applications will be able to use each permission-dependent feature. Keep in mind, though, that this is just a starting point and Android Marshmallow still needs to gain market share and get adopted by OEMs, enabling users with the freedom of choice. You as an app developer must prepare in advance and make sure your application development is forward-facing, allowing new users to enjoy the latest updates as soon as possible while maintaining a high level of performance for your applications.

Chapter 2, App Links, talks about how app linking has become powerful in Android Marshmallow. This allows you, the app developers, help the system better decide how to act. Handling web URLs will give you wider exposure, a bigger funnel into your apps, and better experience, which you can provide to your users (sums up to better ratings and more downloads and vice versa).

App linking is simple to implement, easy to understand, and is a must-have feature in the mobile/web world today. While app linking enables better action handling for users using your applications, users can have multiple devices, expecting the same behavior on each device, and would be more engaged if their data and action handling is all around.

Chapter 3, Apps' Auto Backup, informs you that Android Marshmallow brings with it a great backup feature for apps, reducing friction for users migrating to new devices.

In a world full of such diverse apps, maximizing the benefits from automatic backups leads to excellent user experience. The goal of this feature is to unload the burden and shorten the time required to set up a new device with the user's favorite apps. Allowing the users to enter your app with just a password prompt, if required, after a new installation can be a great experience. Try it yourself!

Chapter 4, Changes Unfold, goes over a few of the changes in Android Marshmallow. All of these changes are important to follow and will help you in your app development cycles. A few more changes are discussed in future chapters with a more detailed approach.

Chapter 5, Audio, Video, and Camera Features, covers quite a few changes and additions to Android APIs. Android Marshmallow is more about helping us, the developers, achieve better media support and showcase our ideas when using audio, video, or camera APIs.

Chapter 6, Android for Work, covers how Android Marshmallow has brought in quite a few changes to the world of Android for Work. As developers, we need to always maintain a viable connection with the needs of an organization. Making sure that we go over and understand the Android for Work world with the changes in Marshmallow helps us build and target enterprise workflows with the added benefit of a simpler API.

Chapter 7, Chrome Custom Tabs, talks about the newly added feature, Chrome custom tabs, that allows us developers to embed web content into our application, modify the UI, and adjust it to our app's theme and colors and the look and feel. This helps us keep the user in our application and still provide a nice UI and overall feel.

Chapter 8, Authentication, discuss how Android Marshmallow gives us a new API to authenticate users with the fingerprint API. We can use the sensor and authenticate the user even within our application and save it for later usage if we want to save the need of user login using the Credentials grace period abilities Android Marshmallow has introduced. We also covered a way to make our application more secure using HTTPS only. The StrictMode policy, enforced with the help of the usesCleartextTraffic flag, allows us to make sure that all the nodes we connect to the outer world are examined to check if there's a need for a secure connection or not.

What you need for this book

For this book, you will require previous knowledge of the Android platform, APIs, and the application development process. You will also need to set up your work environment to have at least the following:

Android Studio, which can be downloaded from https://developer.android.com/sdk/index.htmlThe latest Android SDK tools and platforms. Make sure that you upgrade to the latest versions and add the Android 6.0 (Marshmallow) platform if it's missingAn Android device is helpful, but you may use an emulator if you prefer, or you may use the great solution of Genymotion as an emulator, at https://www.genymotion.com/

Who this book is for