Book Image

Android 6 Essentials

By : Yossi Elkrief
Book Image

Android 6 Essentials

By: Yossi Elkrief

Overview of this book

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.
Table of Contents (16 chapters)
Android 6 Essentials
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

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.html

  • The 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 missing

  • An 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

This book is for Android developers who are looking to move their applications into the next Android version with ease. In the chapters of this book, the author has referred to Android 6 as Android Marshmallow. You should have a good understanding of Java and previous Android APIs, and you should be able to write applications with APIs prior to Marshmallow.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The setTorchMode() method has been added to control the flash torch mode."

A block of code is set as follows:

<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
  <exclude domain="database" path="sensitive_database_name.db"/>
  <exclude domain="sharedpref" path="androidapp_shared_prefs_name"/>
  <exclude domain="file" path="some_file.file_Extension"/>
  <exclude domain="file" path="some_file.file_Extension"/>
</full-backup-content>

Any command-line input or output is written as follows:

$ adb shell sm set-force-adoptable true

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "When heading to Settings | More | VPN, you can now view the VPN apps."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/4412OS_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.