Author Archives: Android Developers

What’s New in Android: O Developer Preview 2 & More

Posted by: Dave Burke, VP of Engineering

android-o-logo.png
With billions of Android devices around the world, Android has surpassed our wildest expectations. Today at Google I/O, we showcased a number of ways we’re pushing Android forward, with the O Release, new tools for developers to help create more performant apps, and an early preview of a project we call Android Go -- a new experience that we’re building for entry-level devices.
Fluid experiences in Android O
It's pretty incredible what you can do on mobile devices today, and how easy it is to rely on them as computers in our pockets. In the O release we've focused on creating fluid experiences that make Android even more powerful and easy to use, and today we highlighted some of those:
  • Picture-in-picture: lets users manage two tasks simultaneously, whether it’s video calling your friend while checking your calendar, or reading a new recipe while watching a video on a specific cooking technique. We’ve designed PIP to provide seamless multitasking on any size screen, and it’s easy for apps to support it.
  • Notification dots extend the reach of notifications, a new way for developers to surface activity in their app, driving engagement. Built on our unique and highly regarded notification system, dots work with zero effort for most apps - we even extract the color of the dot from your icon. 
  • Autofill with Google simplifies setting up a new device and synchronizing passwords by bringing Chrome's Autofill feature to Android. Once a user opts-in, Autofill will work out-of-the-box for most apps. Developers can optimize their apps for Autofill by providing hints about the type of data expected or add support in custom views. 
  • A new homescreen for Android TV makes it easy for users to find, preview, and watch content provided by apps. Apps can publish one or more channels, and users can control the channels that appear on the homescreen. You’ll be able to get started with creating channels using the new TvProvider support library APIs
  • Smart Text Selection: In Android O, we’re applying on-device machine learning to copy/paste, to let Android recognize entities like addresses, URLs, telephone numbers, and email addresses. This makes the copy/paste experience better by selecting the entire entity and surfacing the right apps to carry out an action based on the type of entity.
  • TensorFlow Lite: As Android continues to take advantage of machine learning to improve the user experience, we want our developer partners to be able to do the same. Today we shared an early look at TensorFlow Lite, an upcoming project based on TensorFlow, Google’s open source machine learning library. TensorFlow Lite is specifically designed to be fast and lightweight for embedded use cases. Since many on-device scenarios require real-time performance, we’re also working on a new Neural Network API that TensorFlow can take advantage of to accelerate computation. We plan to make both of these available to developers in a maintenance update to O later this year, so stay tuned!  
(L) Android O: Picture-in-picture, (R) Android O: Notification dots

Working on the Vitals in Android
We think Android’s foundations are critical, so we’re investing in Android Vitals, a project focused on optimizing battery life, startup time, graphic rendering time, and stability. Today we showcased some of the work we’ve done so far, and introduced new tools to help developers understand power, performance, and reliability issues in their apps:
  • System optimizations: in Android O, we’ve done a lot of work across the system to make apps run faster and smoother. For example we made extensive changes in our runtime - including new optimizations like concurrent compacting garbage collection, code locality, and more. 
  • Background limits: up to now it’s been fairly easy for apps to unintentionally overuse resources while they’re in the background, and this can adversely affect the performance of the system. So in O, we've introduced new limits on background location and wi-fi scans, and changes in the way apps run in the background. These boundaries prevent overuse -- they’re about increasing battery life and freeing up memory.
  • New Android Vitals Dashboards in the Play Console: today we launched six Play Console dashboards to help you pinpoint common issues in your apps - excessive crash rate, ANR rate, frozen frames, slow rendering, excessive wakeups, and stuck wake locks, including how many users are affected, with guidance on the best way to address the issues. You can visit the Play Console today to see your app's data, then learn how to address any issues.
Android Go
Part of Android’s mission is to bring computing to everyone. We’re excited about seeing more users come online for the first time as the price of entry level smart phones drop, and we want to help manufacturers continue to offer lower-cost devices that provide a great experience for these users. Today we gave a sneak peek of a new experience that we’re building specifically for Android devices that have 1GB or less of memory -- Internally we call it “Android Go,” and it’s designed around three things
  • OS: We’re optimizing Android O to run smoothly and efficiently on entry-level devices
  • Apps: We’re also designing Google apps to use less memory, storage space, and mobile data, including apps such as YouTube Go, Chrome, and Gboard. 
  • Play: On entry-level devices, Play store will promote a better user experience by highlighting apps that are specifically designed for these devices -- such as apps that use less memory, storage space, and mobile data -- while still giving users access to the entire app catalog.
The Android Go experience will ship in 2018 for all Android devices that have 1GB or less of memory. We recommend getting your apps ready for these devices soon -- take a look at the Building for Billions to learn about the importance of offering a useful offline state, reducing APK size, and minimizing battery and memory use.

O Developer Preview 2, Now in Public Beta
Today’s release of O Developer Preview 2 is our first beta-quality candidate, available to test on your primary phone or tablet. We’re inviting those who want to try the beta release of Android O to enroll now at android.com/beta -- it’s an incredibly convenient way to preview Android O on your Nexus 5X, 6P, and Player, as well as Pixel, Pixel XL, or Pixel C device.

With more users starting to get Android O on their devices through the Android Beta program, now is the time to test your apps for compatibility, resolve any issues, and publish an update as soon as possible. See the migration guide for steps and a recommended timeline.

Later today you’ll be able to download the updated tools for developing on Android O, including the latest canaries of Android Studio, SDK, and tools, Android O system images, and emulators. Along with those, you’ll be able to download support library 26.0.0 beta and other libraries from our new Maven repo. The change to Maven from SDK Manager means a slight change to your build configuration, but gives you much more flexibility in how you integrate library updates with your CI systems.

When you’re ready to get started developing with Android O, visit the O Developer Preview site for details on all of the features you can use in your apps, including notification channels and dots, picture-in-picture, autofill, and others. APIs have changed since the first developer preview, so take a look at the diff report to see where your code might be affected.

Thanks for the feedback you’ve given us so far. Please keep it coming, about Android O features, APIs, issues, or requests -- see the Feedback and Bugs page for details on where to report feedback.

Android Things Developer Preview 4

Posted by Wayne Piekarski, Developer Advocate for IoT

Today, we are releasing the next Developer Preview 4 (DP4) of Android Things, bringing new supported hardware, features, and bug fixes to the platform. The goal of Android Things is to enable Android Developers to quickly build smart devices, and seamlessly scale from prototype to production using a Board Support Package (BSP) provided by Google.
AIY Projects and Google Assistant SDK
Earlier this month, we announced a partnership with AIY Projects, enabling Android Things support for the Raspberry Pi-based Voice Kit. And now with DP4, the necessary drivers are provided to support the Google Assistant SDK on all Android Things certified development boards. Learn more from the instructions in the sample.
New hardware and driver support
We are now adding a new Board Support Package for the NXP i.MX7D, which supports higher performance than the i.MX6UL while still using a low power System on Module (SoM) design. Support for Inter-IC Sound Bus (I2S) has been added to the Peripheral I/O API, now enabling audio drivers to be written in user space for sound hardware connected via an I2S bus. The AIY Voice Kit sample demonstrates how to use I2S support for audio. We have also provided the ability for developers to enable/disable Bluetooth profiles at run time.
NXP i.MX7D System on Module
Production hardware sample
Android Things is very focused on helping developers build production-ready devices that they can bring to market. This means building custom hardware, in addition to the software running on the Android Things system-on-module (SoM). As a part of this effort, we have released Edison Candle, the first in a series of production samples showcasing hardware and software designed to work together. The code is hosted on GitHub and the hardware design files are on CircuitHub, and can be easily fabricated by many 3rd party companies.
Edison Candle sample with source and schematics
Thank you to all the developers who submitted feedback for the previous developer previews. Please continue sending us your feedback by filing bug reports and feature requests, and asking any questions on stackoverflow. To download images for DP4, visit the Android Things download page and find the changes in the release notes. You can also join Google's IoT Developers Community on Google+, a great resource to get updates and discuss ideas, with over 4,900 members. We also have a number of great talks about Android Things and IoT at Google I/O, which you can view via live stream or as a recording later.




Track your subscriptions better with the Google Play Developer API

Posted by Neto Marin, Developer Advocate

Back in 2012, we introduced free trials support for Android app subscriptions. A free trial runs for a period of time that you set and then automatically converts to a full subscription based on the subscription's billing interval and price. Google Play supports free trials for all subscription types. Check out Free trials in our documentation for more details.

This feature is an important tool for user conversion because the user can try your app or game before committing to paying. To help you track the subscription status better, we are adding a third "paymentState" value to the Purchases.subscriptions API (on Google Play Developer API) to represent that the user is in a free trial. Possible values are:

  • 0 - Payment pending
  • 1 - Payment received
  • 2 - Free trial

Since there is a new possible value, it is necessary to check how your back end is handling the paymentState parameter. If you are doing something like this, you potentially could have a problem:

// WARNING: Don't do this!
if (paymentState == 1) {
    // User is in normal state
} else {
    // Handle user in grace period   # this would now be a bug
}

As a best practice, and to avoid issues on future updates, we recommend checking specifically for each possible case, like this:

if (paymentState == 0) {
    // Subscriber with payment pending
} else if (paymentState == 1) {
    // Subscriber in good standing (paid)
} else if (paymentState == 2) {
    // Subscriber in free trial
}

You can check the Purchases.subscriptions documentation for more details. And if you're not offering free trials in your app or game, don't miss the chance to increase user conversions by letting them have a taste of your app - check out our documentation on Free trials.

Here comes Treble: A modular base for Android

Posted by Iliyan Malchev, Project Treble team lead

On the Android team, we view each dessert release as an opportunity to make Android better for our users and our ecosystem partners. One thing we've consistently heard from our device-maker partners is that updating existing devices to a new version of Android is incredibly time consuming and costly.

With Android O, we've been working very closely with device makers and silicon manufacturers to take steps toward solving this problem, and we're excited to give you a sneak peek at Project Treble, the biggest change to the low-level system architecture of Android to date.

Life of an Android Release

First, it's helpful to understand the "life of an Android release". There are several steps a new Android release goes through before getting into the hands of users:

  1. The Android team publishes the open-source code for the latest release to the world.
  2. Silicon manufacturers, the companies that make the chips that power Android devices, modify the new release for their specific hardware.
  3. Silicon manufacturers pass the modified new release to device makers -- the companies that design and manufacture Android devices. Device makers modify the new release again as needed for their devices.
  4. Device makers work with carriers to test and certify the new release.
  5. Device makers and carriers make the new release available to users.

    With Project Treble, we're re-architecting Android to make it easier, faster and less costly for manufacturers to update devices to a new version of Android.

    The Vendor Interface

    Android was unveiled in 2007 as a free, open-source mobile operating system. From the beginning, we intended Android to be scaled across a variety of manufacturers. We knew that consistency of API was important for developers, so we created a compatibility program for the Developer API specified by the Compatibility Definition Document (CDD) and its associated Compatibility Test Suite (CTS), now comprising over a million tests.

    The result today is that app developers can write a single app that works across over a billion devices running on different hardware from different manufacturers.

    Project Treble aims to do what CTS did for apps, for the Android OS framework. The core concept is to separate the vendor implementation - the device-specific, lower-level software written in large part by the silicon manufacturers - from the Android OS Framework. This is achieved by the introduction of a new vendor interface between the Android OS framework and the vendor implementation. The new vendor interface is validated by a Vendor Test Suite (VTS), analogous to the CTS, to ensure forward compatibility of the vendor implementation.

    Benefits of Project Treble

    Today, with no formal vendor interface, a lot of code across Android needs to be updated when a device moves to a newer version of Android:

    With a stable vendor interface providing access to the hardware-specific parts of Android, device makers can choose to deliver a new Android release to consumers by just updating the Android OS framework without any additional work required from the silicon manufacturers:

    Project Treble will be coming to all new devices launched with Android O and beyond. In fact, the new Project Treble architecture is already running on the Developer Preview of O for Pixel phones.

    In addition to the architectural changes, we're working with our silicon and device partners to take their code changes, such as features for a carrier network in a specific country, and move them into the common Android Open Source Project (AOSP) codebase. For example, Sony and Qualcomm contributed dozens of features and hundreds of bugfixes to Android O so they no longer need to rework these patches with each new release of Android.

    We plan to publish the full documentation for Project Treble on source.android.com with the launch of O later this summer.

Build a portfolio of apps as you improve your Android dev skills with the new Advanced Android course

Posted by Jocelyn Becker, Senior Program Manager, Android Training

The Advanced Android App Development online course has been updated, improved, and extended to lead you through building a range of sample apps to learn different advanced aspects of app development.

With the latest self-paced course, you'll learn about fragments by building a mix-and-match game to build Android characters.


You'll build a music quiz app to learn about media players and then create an app that uses widgets to let users plant and water virtual plants.


You'll learn how to use libraries, by building an app that uses Google's Mobile Vision API to recognize whether you're smiling or frowning. To learn how to make your app aware of its location, you'll use the Google Places API with geo fences to silence your phone where a loud notification would spoil the mood.

When you've finished the course, you'll know how to push notifications from a server to client Android apps using Firebase Cloud Messaging, and how to test your user interface with Espresso, a tool that that comes built into Android Studio. Finally, the course covers how to publish your app to Google Play.

Android experts from Google worked with course developers at Udacity to create the new lessons. The course is the next stage in your journey to become a seasoned Android developer; we expect that you will have completed the Developing Android Apps course before taking the advanced course.

The course is available online at Udacity; you can take it in your own time at your own pace. It is available free, or you can take it as part of the Udacity Android Developer Nanodegree.

Go build some awesome apps! Start learning now at https://www.udacity.com/course/ud855.

User experience tips to help you design your app to engage users and drive conversions

By Jenny Gove, Senior Staff UX Researcher, Google Play

We know you work hard to acquire users and grow your customer base, which can be challenging in a crowded market. That's why we've heard from many of you that you find tools like store listing experiments and universal app campaigns are valuable. It's equally important to keep customers engaged from the beginning. Great design and delightful user experiences are fundamental to doing just that.

We partnered with AnswerLab to conduct comprehensive user experience research across a variety of verticals; including e-commerce, insurance, travel, food ordering, ticket sales and services, and financial management. The resulting insights may help you increase engagement and conversion by providing guidance on useful and usable functionality.

The best app experiences seamlessly guide users through their tasks with efficient navigation, search, forms, registration and purchasing. They provide great e-commerce facilities and integrate effective ordering and payment systems. Ultimately, an engaging app begins with attention to usability in all of these areas. Learn tips on:

  • Navigation & Exploration
  • In-App Search
  • Commerce & Conversions
  • Registration
  • Form Entry
  • Usability and Comprehension

You can read the full article, design your app to drive conversions, on the Android Developers website, complete with links to developer resources. Also get the Playbook for Developers app to stay up-to-date with features and best practices that will help you grow a successful business on Google Play.

How useful did you find this blogpost?

Running Android Things on the AIY Voice Kit

Posted by Ryan Bae, Android Things

A major benefit of using Android Things is the ability to prototype connected devices and quickly scale to full commercial products. To further that goal, the Android Things team is partnering with AIY Projects, a new initiative to bring do-it-yourself artificial intelligence to makers. Today, the AIY Projects team launched their first open source reference project: a Raspberry Pi-based Voice Kit with instructions to build a Voice User Interface (VUI) that can use cloud services (like the new Google Assistant SDK or Cloud Speech API) or run completely on-device with TensorFlow. We are releasing a special Android Things Developer Preview 3.1 build for Raspberry Pi 3 to support the Voice Kit. Developers can run Android Things on the Voice Kit with full functionality, including integration with the Google Assistant SDK. To get started, visit the AIY website, download the latest Android Things Developer Preview, and follow the instructions.

The Voice Kit ships out to all MagPi Magazine subscribers on May 4, 2017, and the parts list, assembly instructions, source code, as well as suggested extensions are available on AIY Projects website. The complete kit is also for sale at over 500 Barnes & Noble stores nationwide, as well as UK retailers WH Smith, Tesco, Sainsburys, and Asda.

We are excited to see what you build with the Voice Kit on Android Things. We also encourage you to join Google's IoT Developers Community and Google Assistant SDK Developers on Google+, a great resource to keep up to date and discuss ideas with other developers.

Why you should localize your app or game for Middle East and North Africa

By Mohammad El-Saadi, Business Development, Google Play

The Middle East and North Africa (MENA) region is a fast growing market for app and game developers on Google Play, and localizing is crucial to making the most of the opportunity. For example, the main grossing apps & games in Saudi Arabia have localized their store listings and their actual app and game on Google Play.

The British team behind the Skyscanner travel app had already localised it into more than 15 languages, yet the launch in Arabic was a huge milestone for them. Arabic speaking users really appreciated the localization and the app's average user rating increased from 4.62☆ to 4.77☆ after localization. Users engaged with the app longer, with an increase of 30% in their average session duration. Additionally 50% more travellers have been redirected to Skyscanner partners to book flight, hotel and car hire deals.


Skyscanner opening screen in English and in Arabic
But how difficult is it to correctly localize your app or game to Arabic?

The team at Skyscanner managed to develop Right-To-Left (RTL) Arabic language support within the app in two weeks: "Our initial fear was that we would need lots of manual coding for the layouts. However, the Android layout system handled all of the cases really well. We were already using *Start and *End margin and padding in line with guidelines, but there's also Android Studio support and Lint check to fix any issues automatically." says Tamas Chrenoczy-Nagy, Senior Software Engineer.

Many other top apps and games developers are successfully investing in localizing for MENA users. For example, when game developer Pocket Gems localised War Dragons, the installs by Arabic speaking users tripled. Their percentage of revenue from Arabic language players also went from effectively 0% to ~1.5%.

We just refreshed the Now in Arabic collection (MENA only) with 16 newly localized apps and games, including titles like Netflix, Periscope and Clash of Queen Dragons. It will be live until May 11 on Google Play in the following countries: Algeria, Bahrain, Egypt, Jordan, Kuwait, Lebanon, Morocco, Oman, Qatar, Saudi Arabia, Tunisia and United Arab Emirates.


Check our Localization Checklist for best practices when localizing for any language, and our Going Global Playbook. When your app or game in Arabic is ready, you can self-nominate to be part of future refreshes of the Now in Arabic collection by filling in this form.


How useful did you find this blogpost?

SafetyNet attestation, a building block for anti-abuse

Posted by Arindam Basu, Borbala Benko, Alan Butler, Edward Cunningham, William Luh

Building innovative security features for Android app developers and their users continues to be a priority. As part of this effort, we provide SafetyNet attestation, an API for developers to remotely evaluate whether they are talking to a genuine Android device.

SafetyNet examines software and hardware information on the device to assess its integrity. The result is a cryptographically signed statement, attesting basic properties of the device — such as overall integrity and compatibility with Android (CTS) — as well as metadata about your app, such as its package name and signature. The following JSON snippet shows an example of how the API reports this information:

{
  "nonce": "R2Rra24fVm5xa2Mg",
  "timestampMs": 9860437986543,
  "apkPackageName": "com.package.name.of.requesting.app",
  "apkCertificateDigestSha256": ["base64 encoded, SHA-256 hash of the
                                  certificate used to sign requesting app"],
  "apkDigestSha256": "base64 encoded, SHA-256 hash of the app's APK",
  "ctsProfileMatch": true,
  "basicIntegrity": true,
}
The contents of an example attestation response, providing information about the calling app and the integrity and compatibility of the device.

The SafetyNet attestation API can help your server distinguish traffic coming from genuine, compatible Android devices from traffic coming from less-trusted sources, including non-Android devices. This classification helps you better understand the risks associated with each device so that you can fine-tune preventive or mitigative actions in case of abuse or misbehavior.

We encourage developers to use SafetyNet attestations to augment their anti-abuse strategy. Combine SafetyNet attestation with other signals, such as your existing device-side signals and behavioral signals about what the user is trying to do, in order to build robust, multi-tier protection systems.

For further information, check the recently updated documentation and see the SafetyNet API Samples on GitHub.

The Google Play Awards are returning to Google I/O

Posted by Purnima Kochikar, Director, Apps and Games Business Development, Google Play


Drum roll please! The Google Play Awards are back again this year and will take place Thursday, May 18th at 6:30pm (Pacific Time) during Google I/O, our annual developer festival.

The annual ceremony is a great opportunity for the industry to recognize outstanding developers that continue to set the bar for quality apps and games showing a passion for driving innovation and adoption of new platforms and user experiences.

This year we'll be honoring partners across 12 award categories, some familiar and some new. Nominees were selected much like last year by cross-functional teams throughout Google who work hand-in-hand with the relevant categories and product areas. While category specific criteria can be found below, the common requirements across all categories focused on high star rating, technical performance and freshness, requiring a launch or major update since April 2016. The winners of each category will be announced at Google I/O in May.

The full list of categories and nominees are below and can also be found at g.co/play/GPA2017:

Standout Indie


Games from indie developers that focus on artistic design, gameplay mechanics and overall polish. And the nominees are…… 


Standout Startup


Apps from new developers that offer a unique experience while achieving strong organic install growth. And the nominees are……


Best Android Wear Experience


New wear 2.0 apps offering great design, user delight and functionality. And the nominees are…


Best TV Experience


Apps or games leveraging innovative features for the large-screen format while providing an immersive and intuitive experience. And the nominees are…


Best VR Experience


Highly engaging and immersive experience with optimal use of Daydream UI. And the nominees are…


Best AR Experience


Apps or games harnessing the creative and imaginative technology of AR. And the nominees are…


Best App for Kids


Apps or games with family friendly design that encourage creativity, exploration and education. And the nominees are…


Best Multiplayer Game


Games built to connect gamers in competitive and engaging multiplayer experiences. And the nominees are…



Best App


A true representation of beautiful design, intuitive UX and high user appeal. And the nominees are…


Best Game


Games with strong mechanics, stellar graphics and strong engagement and retention tactics. And the nominees are...


Best Accessibility Experience


Apps or games enabling device interaction in an innovative way that serves people with disabilities or special needs. And the nominees are…


Best Social Impact


Apps that creates meaningful social impact for a broad spectrum of people around the world. And the nominees are…


Join us live at the ceremony May 18th at 6:30 pm PDT at Google I/O or via the live stream to see who wins.


How useful did you find this blogpost?