Showing posts with label Android O. Show all posts
Showing posts with label Android O. Show all posts

Wednesday, May 17, 2017

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.

Friday, May 12, 2017

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 href="https://source.android.com/compatibility/">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 href="https://source.android.com/">source.android.com with the launch of O
later this summer.

Monday, April 10, 2017

Changes to Device Identifiers in Android O


Posted by Giles Hogben, Privacy Engineer




Android O introduces some improvements to help provide user control over the use
of identifiers. These improvements include:





  • limiting the use of device-scoped identifiers that are not resettable

  • updating the Android O Wi-Fi stack in conjunction with changes to the Wi-Fi
    chipset firmware used by Pixel, Pixel XL and Nexus 5x phones to randomize MAC
    addresses in probe requests

  • updating the way that applications request account information and providing
    more user-facing control






Device identifier changes





Here are some of the device identifier changes for Android O:






Android ID






In O, Android ID (Settings.Secure.ANDROID_ID or SSAID) has a different value for
each app and each user on the device. Developers requiring a device-scoped
identifier, should instead use a resettable identifier, such as Advertising
ID
, giving users more control. Advertising ID also provides a user-facing
setting to limit ad tracking.




Additionally in Android O:





  • The ANDROID_ID value won't change on package uninstall/reinstall, as long as
    the package name and signing key are the same. Apps can rely on this value to
    maintain state across reinstalls.

  • If an app was installed on a device running an earlier version of Android,
    the Android ID remains the same when the device is updated to Android O, unless
    the app is uninstalled and reinstalled.

  • The Android ID value only changes if the device is factory reset or if the
    signing key rotates between uninstall and reinstall events.

  • This change is only required for device manufacturers shipping with Google
    Play services and Advertising ID. Other device manufacturers may provide an
    alternative resettable ID or continue to provide ANDROID ID.






Build.SERIAL





To be consistent with runtime permissions required for access to IMEI, use of
android.os.Build.SERIAL is deprecated for apps that target Android O or newer.
Instead, they can use a new Android O API, Build.getSerial(), which
returns the actual serial number, as long as the caller holds the PHONE
permission. In a future version of Android, apps targeting Android O will see
Build.SERIAL as "UNKNOWN". To avoid breaking legacy app functionality, apps
targeting prior versions of Android will continue see the device's serial
number, as before.





Net.Hostname





Net.Hostname provides the network hostname of the device. In previous versions
of Android, the default value of the network hostname and the value of the DHCP
hostname option contained Settings.Secure.ANDROID_ID. In Android O, net.hostname
is empty and the DHCP client no longer sends a hostname, following IETF RFC 7844
(anonymity profile).






Widevine ID






For new devices shipping with O, the Widevine Client ID returns a different
value for each app package name and web origin (for web browser apps).






Unique system and settings properties






In addition to Build.SERIAL, there are other settings and system properties that
aren't available in Android O. These include:





  • ro.runtime.firstboot: Millisecond-precise timestamp of
    first boot after last wipe or most recent boot

  • htc.camera.sensor.front_SN: Camera serial number (available
    on some HTC devices)

  • persist.service.bdroid.bdaddr: Bluetooth MAC address
    property

  • Settings.Secure.bluetooth_address: Device Bluetooth MAC
    address. In O, this is only available to apps holding the LOCAL_MAC_ADDRESS
    permission.






MAC address randomization in Wi-Fi probe requests





We collaborated with security researchers1 to design robust MAC address randomization for Wi-Fi
scan traffic produced by the chipset firmware in Google Pixel and Nexus 5X
devices. The Android Connectivity team then worked with manufacturers to update
the Wi-Fi chipset firmware used by these devices.




Android O integrates these firmware changes into the Android Wi-Fi stack, so
that devices using these chipsets with updated firmware and running Android O or
above can take advantage of them.




Here are some of the changes that we've made to Pixel, Pixel XL and Nexus 5x
firmware when running O+:





  • For each Wi-Fi scan while it is disconnected from an access point, the phone uses a new random MAC address (whether or not the device is in standby).

  • The initial packet sequence number for each scan is also randomized.

  • Unnecessary Probe Request Information Elements have been removed:
    Information Elements are limited to the SSID and DS parameter sets.






Changes in the getAccounts API





In Android O and above, the GET_ACCOUNTS permission is no longer sufficient to
gain access to the list of accounts registered on the device. Applications must
use an API provided by the app managing the specific account type or the user
must grant permission to access the account via an account chooser activity. For
example, Gmail can access Google accounts registered on the device because
Google owns the Gmail application, but the user would need to grant Gmail access
to information about other accounts registered on the device.




Apps targeting Android O or later should either use
AccountManager#newChooseAccountIntent() or an authenticator-specific method to
gain access to an account. Applications with a lower target SDK can still use
the current flow.




In Android O, apps can also use the AccountManager.setAccountVisibility()/
getVisibility() methods to manage visibility policies of accounts owned by those
apps.




In addition, the LOGIN_ACCOUNTS_CHANGED_ACTION broadcast is deprecated, but
still works in Android O. Applications should use
addOnAccountsUpdatedListener() to get updates about accounts at runtime for a
list of account types that they specify.




Check out Best
Practices for Unique Identifiers
for more information.









Notes







  1. Glenn Wilkinson and team at Sensepost, UK, C�lestin Matte, Mathieu Cunche:
    University of Lyon, INSA-Lyon, CITI Lab, Inria Privatics, Mathy Vanhoef, KU Leuven ?




Tuesday, March 21, 2017

O-MG, the Developer Preview of Android O is here!





Posted by Dave Burke, VP of Engineering

Since the first launch in 2008, the Android project has thrived on the incredible feedback from our vibrant ecosystems of app developers and device makers, as well as of course our users. More recently, we've been pushing hard on improving our engineering processes so we can share our work earlier and more openly with our partners.

So, today, I'm excited to share a first href="http://developer.android.com/preview">developer preview of the next version of the OS: Android O. The usual caveats apply: it's early days, there are more features coming, and there's still plenty of stabilization and performance work ahead of us. But it's booting :).

Over the course of the next several months, we'll be releasing updated developer previews, and we'll be doing a deep dive on all things Android at href="https://events.google.com/io/">Google I/O in May. In the meantime, we'd love your feedback on trying out new features, and of course testing your apps on the new OS.

What's new in O?

Android O introduces a number of new features and APIs to use in your apps. Here's are just a few new things for you to start trying in this first Developer Preview:

Background limits: Building on the work we began in Nougat, Android O puts a big priority on improving a user's battery life and the device's interactive performance. To make this possible, we've put additional automatic limits on what apps can do in the background, in three main areas: implicit broadcasts, background services, and location updates. These changes will make it easier to create apps that have minimal impact on a user's device and battery. Background limits represent a significant change in Android, so we want every developer to get familiar with them. Check out the documentation on href="https://developer.android.com/preview/features/background.html">background execution limits and href="https://developer.android.com/preview/features/background-location-limits.html">background location limits for details.

Notification channels: Android O also introduces href="https://developer.android.com/preview/features/notification-channels.html">notification channels, which are new app-defined categories for notification content. Channels let developers give users fine-grained control over different kinds of notifications — users can block or change the behavior of each channel individually, rather than managing all of the app's notifications together.

Notification channels let users control your app's notification categories

Android O also adds new visuals and grouping to notifications that make it easier for users to see what's going on when they have an incoming message or are glancing at the notification shade.

Autofill APIs: Android users already depend on a range of password managers to autofill login details and repetitive information, which makes setting up new apps or placing transactions easier. Now we are making this work more easily across the ecosystem by adding platform support for autofill. Users can select an autofill app, similar to the way they select a keyboard app. The autofill app stores and secures user data, such as addresses, user names, and even passwords. For apps that want to handle autofill, we're href="https://developer.android.com/preview/features/autofill.html">adding new APIs to implement an Autofill service.

PIP for handsets and new windowing features: href="https://developer.android.com/preview/api-overview.html#opip">Picture in Picture (PIP) display is now available on phones and tablets, so users can continue watching a video while they're answering a chat or hailing a car. Apps can put themselves in PiP mode from the resumed or a pausing state where the system supports it - and you can specify the aspect ratio and a set of custom interactions (such as play/pause). Other new windowing features include a href="https://developer.android.com/preview/behavior-changes.html?#cwt">new app overlay window for apps to use instead of system alert window, and href="https://developer.android.com/preview/api-overview.html#mds">multi-display support for launching an activity on a remote display.

Font resources in XML: href="https://developer.android.com/preview/features/working-with-fonts.html">Fonts are now a fully supported resource type in Android O. Apps can now use fonts in XML layouts as well as define font families in XML — declaring the font style and weight along with the font files.

Adaptive icons: To help you integrate better with the device UI, you can now create href="https://developer.android.com/preview/features/adaptive-icons.html"> adaptive icons that the system displays in different shapes, based on a mask selected by the device. The system also animates interactions with the icons, and uses them in the launcher, shortcuts, Settings, sharing dialogs, and in the overview screen.

Adaptive icons display in a variety of shapes across different device models.

Wide-gamut color for apps: Android developers of imaging apps can now take advantage of new devices that have a wide-gamut color capable display. To display wide gamut images, apps will need to enable a flag in their manifest (per activity) and load bitmaps with an embedded wide color profile (AdobeRGB, Pro Photo RGB, DCI-P3, etc.).

Connectivity: For the ultimate in audio fidelity, Android O now also supports high-quality Bluetooth audio codecs such as href="https://www.sony.net/Products/LDAC/">LDAC codec. We're also adding new Wi-Fi features as well, like Wi-Fi Aware, previously known as Neighbor Awareness Networking (NAN). On devices with the appropriate hardware, apps and nearby devices can discover and communicate over Wi-Fi without an Internet access point. We're working with our hardware partners to bring Wi-Fi Aware technology to devices as soon as possible.

The Telecom framework is extending ConnectionService APIs to enable third party calling apps integrate with System UI and operate seamlessly with other audio apps. For instance, apps can have their calls displayed and controlled in different kinds of UIs such as car head units.

Keyboard navigation: With the advent of Google Play apps on Chrome OS and other large form factors, we're seeing a resurgence of keyboard navigation use within these apps. In Android O we focused on building a more reliable, predictable model for "arrow" and "tab" navigation that aids both developers and end users.

AAudio API for Pro Audio: AAudio is a new native API that's designed specifically for apps that require high-performance, low-latency audio. Apps using AAudio read and write data via streams. In the Developer Preview we're releasing an early version of this new API to get your feedback.

WebView enhancements: In Android Nougat we introduced an optional multiprocess mode for WebView that moved the handling of web content into an isolated process. In Android O, we're enabling multiprocess mode by default and adding an href="https://developer.android.com/preview/features/managing-webview.html">API to let your app handle errors and crashes, for enhanced security and improved app stability. As a further security measure, you can now opt in your app's WebView objects to href="https://developer.android.com/preview/features/managing-webview.html#gsb">verify URLs through Google Safe Browsing.

Java 8 Language APIs and runtime optimizations: Android now supports several new Java Language APIs, including the new java.time API. In addition, the Android Runtime is faster than ever before, with improvements of up to 2x on some application benchmarks.

Partner platform contributions: Hardware manufacturers and silicon partners have accelerated fixes and enhancements to the Android platform in the O release. For example, Sony has contributed more than 30 feature enhancements including the href="https://www.sony.net/Products/LDAC/">LDAC codec and 250 bug fixes to Android O.

Get started in a few simple steps

First, make your app compatible to give your users a seamless transition to Android O. Just download a href="https://developer.android.com/preview/download.html">device system image or emulator system image, install your current app, and test -- the app should run and look great, and handle href="https://developer.android.com/preview/behavior-changes.html">behavior changes properly. After you've made any necessary updates, we recommend publishing to Google Play right away without changing the app's platform targeting.

Building with Android O

When you're ready, dive in to O in depth to learn about everything you can take advantage of for your app. Visit the href="https://developer.android.com/preview/index.html">O Developer Preview site for details on the href="https://developer.android.com/preview/overview.html">preview timeline, href="https://developer.android.com/preview/behavior-changes.html">behavior changes, href="https://developer.android.com/preview/api-overview.html">new APIs, and href="https://developer.android.com/preview/feedback.html">support resources.

Plan how your app will support href="https://developer.android.com/preview/features/background.html">background limits and href="https://developer.android.com/preview/behavior-changes.html#o-apps">other changes. Try out some of the great new features in your app -- href="https://developer.android.com/preview/features/notification-channels.html">notification channels, href="https://developer.android.com/preview/api-overview.html#opip">PIP, href="https://developer.android.com/preview/features/adaptive-icons.html">adaptive icons, href="https://developer.android.com/preview/features/working-with-fonts.html">font resources in XML, href="https://developer.android.com/preview/features/autosizing-textview.html">autosizing TextView, and href="https://developer.android.com/preview/api-overview.html">many others. To make it easier to explore the new APIs in Android O, we've brought the href="https://developer.android.com/sdk/api_diff/o-dp1/changes.html">API diff report online, along with the href="https://developer.android.com/reference/packages.html">Android O API reference.

The latest canary version of href="https://developer.android.com/studio/preview/">Android Studio 2.4 includes new features to help you get started with Android O. You can download and set up the O preview SDK from inside Android Studio, then use Android O's href="https://developer.android.com/preview/features/working-with-fonts.html">XML font resources and href="https://developer.android.com/preview/features/autosizing-textview.html">autosizing TextView in the Layout Editor. Watch for more Android O support coming in the weeks ahead.

We're also releasing an href="https://developer.android.com/topic/libraries/support-library/revisions.html">alpha version of the 26.0.0 support library for you to try. This version adds a number of new APIs and increases the minSdkversion to 14. Check out the release notes for details.

Preview updates

The O Developer Preview includes an updated SDK with system images for testing on the official Android Emulator and on Nexus 5X, Nexus 6P, Nexus Player, Pixel, Pixel XL and Pixel C devices. If you're building for wearables, there's also an emulator for testing Android Wear 2.0 on Android O.

We plan to update the preview system images and SDK regularly throughout the O Developer Preview. This initial preview release is for developers only and not intended for daily or consumer use, so we're making it available by manual download and flash only. href="https://developer.android.com/preview/download.html">Downloads and instructions are here.

As we get closer to a final product, we'll be inviting consumers to try it out as well, and we'll open up enrollments through Android Beta at that time. Stay tuned for details, but for now please note that Android Beta is not currently available for Android O.

Give us your feedback

As always, your feedback is crucial, so please href="https://developer.android.com/preview/feedback.html">let us know what you think — the sooner we hear from you, the more of your feedback we can integrate. When you find issues, please href="https://issuetracker.google.com/issues/new?component=190602&template=809005">report them here. We've moved to a more robust tool, href="https://issuetracker.google.com">Issue Tracker, which is also used internally at Google to track bugs and feature requests during product development. We hope you'll find it href="https://developers.google.com/issue-tracker/">easier to use.