Author Archives: Android Developers

Android Studio 3.0 Canary 1




By Jamal Eason, Product Manager, Android

Just in time for Google I/O 2017, we're providing a sneak peak of Android Studio 3.0 - available to download today on our canary release channel. Android Studio's our official IDE, purpose-built for Android, and we keep increasing our investment. The feature set in Android Studio is focused on accelerating your app development flow and providing the latest tools built for the Android platform.

To accelerate your development flow, Android Studio 3.0 includes three major features: a new suite of app performance profiling tools to quickly diagnose performance issues, support for the Kotlin programming language, and increased Gradle build speeds for large sized app projects. Android Studio 3.0 also tightly integrates with Android platform development with these additional key features: support for Instant App development, inclusion of the Google Play Store in the Android O emulator system images, and new wizards for Android O development. Overall, this first canary release of Android Studio 3.0 has 20+ new features.

We have been quietly iterating on many of these features as part of the Android Studio 2.4 Canaries. Today we are renumbering the release to Android Studio 3.0 after recognizing that we added many significant features, and that we had to introduce a rare breaking change in the Android Gradle Plugin to improve scalability and build times. If you want to target Android O, create an Instant App, start developing with the Kotlin language or use the latest in Android app performance tools to improve your app quality then you should download Android Studio 3.0 Canary 1 today.
Android DevByte - What’s New in Android Studio 3.0 Canary 1


Check out the the list below organized into key developer flow for the details of the new features in this first canary release of Android Studio 3.0.

Develop


  • Kotlin Programming Language - By popular request, Android Studio 3.0 now includes support for Kotlin. With this new language support, you can seamlessly add Kotlin code next to your existing Android app code and have access to all the great development tools found in Android Studio. You can choose to add Kotlin to your project using the built-in conversion tool found under CodeConvert Java File to Kotlin File, or you choose to create a Kotlin enabled project with the New Project Wizard. Lean more about Kotlin language support in Android and Android Studio.

Kotlin Language Conversion in Android Studio


  • Java 8 Language features - We are continuing to evolve the support for Java 8 language features and APIs. With the recent deprecation of the Jack toolchain and migration to the javac based toolchain, you have access to features such as Instant Run for projects using the Java 8 language features in Android Studio. To update your project to support the new Java 8 Language toolchain, simply update your Source and Target compatibility levels to 1.8 in the Project Structure dialog. Learn more.
Update Project Structure Dialogue for Java 8 Language




  • Layout Editor - With this Android Studio release, you will find additional enhancements to the Layout Editor. We have updated the component tree with better drag-and-drop view insertions, and a new error panel. In coordination with an update to ConstraintLayout, the Layout Editor also supports creating view Barriers, creating Groups, and enhances Chain Creation. Learn more.
Layout Editor Component Tree & Warning Panel



  • Adaptive Icon Wizard - Android O introduces adaptive launcher icons, which can display in different shapes across different Android devices. The new Adaptive Launcher Icon wizard creates the new and legacy launcher icon assets and provides previews of how your adaptive icon will look on different launcher screen icon masks. Create a new asset by right-clicking on the /res folder in your project then navigate to → NewImage AssetLauncher Icons (Adaptive and Legacy) Learn more.
Adaptive Icon Wizard



  • XML Fonts & Downloadable Fonts - Adding custom fonts to your app (available when targeting Android O) is now even easier with the XML fonts preview and font selection tools in Android Studio. You can can also create a downloadable font resource for your app. Using downloadable fonts allows you to use a custom font in your app while avoiding the need to bundle in a font resource into your APK. To use downloadable fonts, ensure that you device or emulator is running Google Play Services v11.2.63 or higher. Learn more.
Downloadable Fonts Resource Picker

XML Fonts Preview




  • Android Things Support - With Android Studio 3.0, you can start developing on Android Things with a new set of templates in the New Project wizard and the New Module wizard. Android Things allows you to extend your Android development knowledge into the Internet of Things (IoT) device category. Learn more.

Android Things New Module Wizard 




  • IntelliJ Platform Update: Android Studio 3.0 Canary 1 includes the IntelliJ 2017.1 release, which has features such as Java 8 language refactoring, parameter hints, semantic highlighting, draggable breakpoints, enhanced version control search, and more. Learn more.

Build

  • Instant App Support - With Android Studio 3.0, you can create Instant Apps in your project. Instant Apps are lightweight Android apps that your users can immediately run without installation. To support this, Android Studio introduces two new module types: instant app and feature. Combined with a new "Modularize" refactoring action and the App Links Assistant, Android Studio can help you extend your app into an Instant App. To use you can use the New Module Wizard or right-click on a class and navigate to: RefactorModularize Learn more.

Instant App Module Wizard



  • Build Speed Improvements - We are continuing to invest in making build speeds faster. For this release, we focused on improving speed for projects that have many modules. To achieve these speed improvements and to support future enhancements, we have made breaking API changes to the Android Gradle plugin used by Android Studio. If you depended on APIs provided by the previous plugin you should validate compatibility with the new plugin and migrate applicable APIs. To test, update the plugin version in your build.gradle file. Learn more.



build.gradle

dependencies {
   classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
}
  • Google's Maven Repository - Also, by popular request, we are now distributing the Android Support Library maven dependencies outside of the Android SDK Manager in a brand new Maven repository. For those developing with a Continuous Integration (CI) system, this should make Maven dependency management easier. Used in combination with the latest command line SDK Manager tool and Gradle, CI builds should be easier to manage with Google's Maven Repository. To use the the new Maven location, add the following url to your app module's build.gradle file. Learn more.
build.gradle
repositories {
   maven {
       url "https://maven.google.com"
   }
}



    Test & Debug

    • Google Play System Images - Along with the update to the Android O Beta release, we updated the Android Emulator O system images to include the Google Play Store. Bundling in the Google Play store allows you to do end-to-end testing of apps with Google Play, and provides a convenient way to keep Google Play services up-to-date in your Android Virtual Device (AVD). Just as Google Play services updates on physical devices, you can trigger the same updates on your AVDs.
    Google Play Store in Android Emulator



    Update Google Play Services in Android Emulator




    To ensure app security and a consistent experience with physical devices, the emulator system images with the Google Play store included are signed with a release key. This means you will not be able to get elevated privileges. If you require elevated privileges (root) to aid with your app troubleshooting, you can use the Android Open Source Project (AOSP) emulator system images that do not include Google apps or services. To get started, make sure you are using Android Emulator v26.1+, the latest system images API 24+ and then create a new AVD with a Google Play icon next to the device definition. Learn more.


    Android Virtual Device Manager with Google Play Store Support 





    • OpenGL ES 3.0 Support in Android Emulator - As a part of our ongoing investment in making your development experience fast, the latest version of the Android Emulator has OpenGL ES 3.0 support for Android O system images along with significant improvements in OpenGL ES 2.0 graphics performance for older emulator system images. Most modern graphics cards on all operating systems support OpenGL ES 2.0 acceleration. To use OpenGL ES 3.0 with the Android Emulator, your development machine needs a host GPU graphics card that supports OpenGL 3.2 or higher on Microsoft® Windows® or Linux (with Apple MacOS® support coming in the future). Learn more.


    OpenGL ES 3.0 in Android Emulator




    • App Bug Reporter in Android Emulator - To help in documenting bugs in your app, we have added an easier way to generate a bug report with all the necessary configuration settings and space to capture your repro steps. Additionally, if you want to share a specific emulator bug with the Android team, we have also added a link to quickly generate a bug on the Android Issue Tracker. To use this feature, navigate to the Emulator Tool BarExtended ControlsHelpEmulator HelpFile a Bug. Learn more.

    App Bug Reporting in Android Emulator


    • Proxy Support in Android - For those who need to use a HTTP proxy to access the Internet, we have added a user interface to manage the proxy settings used by the emulator. By default, the Android Emulator will now use the settings from Android Studio, but you can override these settings for your network setup. To configure navigation to the Extended ControlsSettingsProxy.
    Android Emulator Proxy Settings


    • Android Wear Rotary Controls in Android Emulator - The Android Emulator now supports rotary controls for the Android Wear 2.0 emulator system image. It is now easier to test your apps that target Android Wear devices that include rotary input scrolling. To enable, create an Emulator AVD that targets Android Wear, and the Rotary Input panel should appear under Extended controls. Learn more.

    Rotary input in Android Emulator



    • APK Debugging - For those of you who just want to debug an APK without building your project in Android Studio, the Android Studio 3.0 release now has the ability to debug an arbitrary APK. This functionally is especially helpful for those who develop your Android C++ code in another development environment, but want to debug and analyze the APK in the context of Android Studio. As long as you have a debuggable version of your APK, you can use the new APK Debugging features to analyze, profile & debug the APK. Moreover, if you have access to the sources of your APK, you can link the source to the APK debugging flow for a higher fidelity debugging process. Get started by simply selecting Profile or debug APK from the Android Studio Welcome Screen or File → Profile or debug APKLearn More.

    Profile or Debug an APK


    APK Debugging


    • Layout Inspector - You will find that the Layout Inspector has a few additional enhancements in Android Studio 3.0 that make it easier to debug issues in your app layouts. A couple of the enhancements include better grouping of properties into common categories, as well as search functionality in both the View Tree and Properties Panels. While an application is running, access the Layout Inspector via ToolsAndroidLayout Inspector. Learn more.
    Layout Inspector


    • Device File Explorer - Ported from DDMS into Android Studio by popular demand, the new Device File Explorer allows you to view the file and directory structure of your Android device or emulator. As you are testing your app, you can now quickly preview and modify app data files directly in Android Studio.

    Device File Explorer



    Optimize

    • Android Profiler - Android Studio 3.0 includes a brand new suite of tools to help debug performance problems in your app. We completely rewrote the previous set of Android Monitor tools, and replaced them with the Android Profiler. Once you deploy your app to a running device or emulator, click on the Android Profiler tab and you will now have access to a real-time & unified view of the CPU, Memory, & Network activity for your app. Each of the performance events are mapped to the UI event timeline which highlights touch events, key presses, and activity changes so that you have more context on when and why a certain event happened.  Click on each timeline to dig into each performance aspect of your app. Learn more

    Android Profiler - Combined timeline view.

    • CPU Profiler - Unnecessary CPU processing and load spikes are symptoms of poor app performance. With the CPU Profiler, you can analyze the CPU thread usage of your app by triggering a sample or instrumented CPU trace. At this point, you can troubleshoot CPU performance issues using a variety of data views and filters built into the CPU Profiler. Learn more.

    CPU Profiler


    • Memory Profiler - Using memory inefficiently can lead to many device problems ranging from a janky UI to low memory events. The Memory Profiler combines the functionality of the previous Heap Viewer and Allocation Tracker in one rich interface to help debug memory usage problems in your app. You can diagnose a range of memory issues by analyzing memory allocations, heap dumps and more. Learn more.

    Memory Profiler



    • Network Profiler - Optimizing foreground and background network usage in your app can lead to a more performant app and lower app data usage. The network profiler allows you to monitor the network activity of your app, inspect the payload of each of your network requests, and link back to the line of source code that generated the network request. Currently, the network profiler works with HttpURLConnection, OkHttp, and Volley network libraries. The network profiler is an advanced analysis feature that can be enabled on Pre-Android O devices & emulators by selecting Enable Advanced Profiling in the Profiling Tab in the Run Configuration box. In addition to enabling network request and payload analysis, this checkbox enables event collection at the top level, memory object count, and memory garbage collection. For Android O-based devices and emulator, just deploy your app. Learn more.
    Network Profiler




    Network Profiler Setup for Pre- Android O Devices


    • APK Analyzer Improvements - In Android Studio 3.0, we have added some additional enhancements to the APK Analyzer to help you further optimize the size of your APK. With this feature update, you can now analyze Instant App zip files & AARs, and view dex bytecode of classes & methods. You can also generate Proguard configuration rules and load Proguard mapping files in the dex viewer. Learn more.

    APK Analyzer
    Check out the release notes for more details.

    Getting Started  

    Download

    If you are using a previous version of Android Studio, you can install Android Studio 3.0 Canary 1 alongside your stable version. You can download this update from the official Android Studio Preview download page. As mention in this blog, there are some breaking Gradle Plugin API changes to support new features in the IDE. Therefore, you should also update your Android Gradle plugin version to 3.0.0-alpha1 in your current project to test and validate your app project setup.


    We appreciate any feedback on things you like, issues or features you would like to see. If you find a bug or issue, feel free to file an issue. Connect with us -- the Android Studio development team ‐ on our Google+ page or on Twitter.




    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.