Developer android com


Android, the world's most popular mobile platform

Android powers hundreds of millions of mobile devices in more than 190 countries around the world. It's the largest installed base of any mobile platform and growing fast—every day another million users power up their Android devices for the first time and start looking for apps, games, and other digital content.

Android gives you a world-class platform for creating apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

Android growth in device activations

Global partnerships and large installed base

Building on the contributions of the open-source Linux community and more than 300 hardware, software, and carrier partners, Android has rapidly become the fastest-growing mobile OS.

Every day more than 1 million new Android devices are activated worldwide.

Android’s openness has made it a favorite for consumers and developers alike, driving strong growth in app consumption. Android users download more than 1.5 billion apps and games from Google Play each month.

With its partners, Android is continuously pushing the boundaries of hardware and software forward to bring new capabilities to users and developers. For developers, Android innovation lets you build powerful, differentiated applications that use the latest mobile technologies.

Powerful development framework

Easily optimize a single binary for phones, tablets, and other devices.

Android gives you everything you need to build best-in-class app experiences. It gives you a single application model that lets you deploy your apps broadly to hundreds of millions of users across a wide range of devices—from phones to tablets and beyond.

Android also gives you tools for creating apps that look great and take advantage of the hardware capabilities available on each device. It automatically adapts your UI to look its best on each device, while giving you as much control as you want over your UI on different device types.

For example, you can create a single app binary that's optimized for both phone and tablet form factors. You declare your UI in lightweight sets of XML resources, one set for parts of the UI that are common to all form factors and other sets for optimzations specific to phones or tablets. At runtime, Android applies the correct resource sets based on its screen size, density, locale, and so on.

To help you develop efficiently, the Android Developer Tools offer a full Java IDE with advanced features for developing, debugging, and packaging Android apps. Using the IDE, you can develop on any available Android device or create virtual devices that emulate any hardware configuration.

1.5 billion downloads a month and growing. Get your apps in front of millions of users at Google's scale.

Open marketplace for distributing your apps

Google Play is the premier marketplace for selling and distributing Android apps. When you publish an app on Google Play, you reach the huge installed base of Android.

As an open marketplace, Google Play puts you in control of how you sell your products. You can publish whenever you want, as often as you want, and to the customers you want. You can distribute broadly to all markets and devices or focus on specific segments, devices, or ranges of hardware capabilities.

You can monetize in the way that works best for your business—priced or free, with in-app products or subscriptions—for highest engagement and revenues. You also have complete control of the pricing for your apps and in-app products and can set or change prices in any supported currency at any time.

Beyond growing your customer base, Google Play helps you build visibility and engagement across your apps and brand. As your apps rise in popularity, Google Play gives them higher placement in weekly "top" charts and rankings, and for the best apps promotional slots in curated collections.

Preinstalled on hundreds of millions of Android devices around the world, Google Play can be a growth engine for your business.

GET STARTED

developer.android.com

Platform Architecture | Android Developers

Android is an open source, Linux-based software stack created for a wide array of devices and form factors. The following diagram shows the major components of the Android platform.

Figure 1. The Android software stack.

The Linux Kernel

The foundation of the Android platform is the Linux kernel. For example, the Android Runtime (ART) relies on the Linux kernel for underlying functionalities such as threading and low-level memory management.

Using a Linux kernel allows Android to take advantage of key security features and allows device manufacturers to develop hardware drivers for a well-known kernel.

Hardware Abstraction Layer (HAL)

The hardware abstraction layer (HAL) provides standard interfaces that expose device hardware capabilities to the higher-level Java API framework. The HAL consists of multiple library modules, each of which implements an interface for a specific type of hardware component, such as the camera or bluetooth module. When a framework API makes a call to access device hardware, the Android system loads the library module for that hardware component.

Android Runtime

For devices running Android version 5.0 (API level 21) or higher, each app runs in its own process and with its own instance of the Android Runtime (ART). ART is written to run multiple virtual machines on low-memory devices by executing DEX files, a bytecode format designed specially for Android that's optimized for minimal memory footprint. Build toolchains, such as Jack, compile Java sources into DEX bytecode, which can run on the Android platform.

Some of the major features of ART include the following:

  • Ahead-of-time (AOT) and just-in-time (JIT) compilation
  • Optimized garbage collection (GC)
  • Better debugging support, including a dedicated sampling profiler, detailed diagnostic exceptions and crash reporting, and the ability to set watchpoints to monitor specific fields

Prior to Android version 5.0 (API level 21), Dalvik was the Android runtime. If your app runs well on ART, then it should work on Dalvik as well, but the reverse may not be true.

Android also includes a set of core runtime libraries that provide most of the functionality of the Java programming language, including some Java 8 language features, that the Java API framework uses.

Native C/C++ Libraries

Many core Android system components and services, such as ART and HAL, are built from native code that require native libraries written in C and C++. The Android platform provides Java framework APIs to expose the functionality of some of these native libraries to apps. For example, you can access OpenGL ES through the Android framework’s Java OpenGL API to add support for drawing and manipulating 2D and 3D graphics in your app.

If you are developing an app that requires C or C++ code, you can use the Android NDK to access some of these native platform libraries directly from your native code.

Java API Framework

The entire feature-set of the Android OS is available to you through APIs written in the Java language. These APIs form the building blocks you need to create Android apps by simplifying the reuse of core, modular system components and services, which include the following:

  • A rich and extensible View System you can use to build an app’s UI, including lists, grids, text boxes, buttons, and even an embeddable web browser
  • A Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files
  • A Notification Manager that enables all apps to display custom alerts in the status bar
  • An Activity Manager that manages the lifecycle of apps and provides a common navigation back stack
  • Content Providers that enable apps to access data from other apps, such as the Contacts app, or to share their own data

Developers have full access to the same framework APIs that Android system apps use.

System Apps

Android comes with a set of core apps for email, SMS messaging, calendars, internet browsing, contacts, and more. Apps included with the platform have no special status among the apps the user chooses to install. So a third-party app can become the user's default web browser, SMS messenger, or even the default keyboard (some exceptions apply, such as the system's Settings app).

The system apps function both as apps for users and to provide key capabilities that developers can access from their own app. For example, if your app would like to deliver an SMS message, you don't need to build that functionality yourself—you can instead invoke whichever SMS app is already installed to deliver a message to the recipient you specify.

developer.android.com

Developer Guide | Android Developers

Android enterprise provides organizations with a secure, flexible, and unified Android mobility platform—combining devices, applications, and management. Android apps are compatible with Android enterprise by default. However, there are additional features you can use to make your app work best on managed Android devices:

Prerequisites

  1. You’ve created an Android app.
  2. You’re ready to modify your app so that it works best with Android in the enterprise.
  3. Minimum version: Android 5.0 Lollipop recommended version: Android 6.0 Marshmallow and later.

Note: Android's enterprise features function natively on most Android 5.0 devices; however, Android 6.0 and later offers additional features, especially with regard to COSU.

Manage Profiles

You can manage a user’s business data and applications through a work profile. A work profile is a managed corporate profile associated with the primary user account on an Android device. A work profile securely isolates work apps and data from personal apps and data. This work profile is in a separate container from the personal profile, which your user controls. These separate profiles allow organizations to manage the business data they care about, but leave everything else on a user’s device under the user’s control. For a deep dive into best practices, see the Set up Managed Profiles guide. For an overview of those best practices, see below.

Key features of a managed profile

  • Separate and secure profile
  • Managed Google Play for application distribution
  • Separate badged work applications
  • Profile-only management capabilities controlled by an administrator

Managed profile benefits on Android 5.0+

  • Full device encryption
  • One Android application package (APK) for both profiles when there’s a personal profile and a work profile present on the device
  • Device policy controller (DPC) is limited to the managed profile
  • Device administration via the DevicePolicyManager class

Considerations for managed profiles

Prevent intents from failing between profiles

It’s difficult to know which intents can cross between profiles, and which ones are blocked. The only way to know for sure is by testing. Before your app starts an activity, you should verify that the request is resolved by calling Intent.resolveActivity().

  • If it returns null, the request doesn’t resolve.
  • If it returns something, it shows that the intent resolves, and it’s safe to send the intent.

Note: For detailed testing instructions, see Prevent Failed Intents.

Share files across profiles

Some developers use URIs to mark file paths in Android. However, because there are separate profiles in Android enterprise, we recommend:

Use:Content URIs
  • The content URIs contain the authority, path, and ID for a specific file. You can generate this using FileProvider subclass. Learn more
  • Share and grant permissions to access the content URI using an Intent. Permissions can only be passed across the profile boundary using Intents. If you grant another app access rights to your file using Context.grantUriPermission(), it only is granted for that app in the same profile.
Don't use:File URI
  • Contains the absolute path of the file on the device’s storage.
  • A file path URI that’s valid on one profile isn’t valid on the other.
  • If you attach a file URI to an intent, a handler is unable to access the file in another profile.

Next steps: Once your app supports managed profiles, test it in a work profile. See Test your App with Android in the enterprise.

Implementing Managed Configurations

Managed configurations are a set of instructions that IT administrators can use to manage their users’ mobile devices in a specific way. These instructions are universal and work across any EMM, allowing administrators to remotely configure applications on their users’ phones.

If you’re developing apps for business or government, you may need to satisfy your industry’s specific set of requirements. Using managed configurations, the IT administrator can remotely specify settings and enforce policies for their users’ Android apps; for example:

  • Configure if an app can sync data via cellular/3G, or only Wi-Fi
  • Whitelist or blacklist URLs on a web browser
  • Configure an app's email settings
  • Enable or disable printing
  • Manage bookmarks

Best practices for implementing managed configurations

The Set up Managed Configurations guide is the key source for information on how to build and deploy managed configurations. After you’ve reviewed this documentation, see recommendations below for additional guidance.

When first launching the app

As soon as you launch an application, you can see if managed configurations are already set for this app in onStart() or onResume(). Additionally, you can find out if your application is managed or unmanaged. For example, if getApplicationRestrictions() returns:

  • A set of application-specific restrictions—You can configure the managed configurations silently (without requiring user input).
  • An empty bundle—Your application acts like it’s unmanaged (for example, how the app behaves in a personal profile).
  • A bundle with a single key value pair with KEY_RESTRICTIONS_PENDING set to true—your application is being managed, but the DPC isn’t configured correctly. You should block this user from your app, and direct them to their IT administrator.
Listen for changes to managed configurations

IT administrators can change managed configurations and what policies they want to enforce on their users at any time. Because of this, we recommend you ensure that your app can accept new restrictions for your managed configuration as follows:

  • Fetch restrictions on launch—Your app should call getApplicationRestrictions() in onStart() and onResume(), and compare against old restrictions to see if changes are required.
  • Listen while running—Dynamically register ACTION_APPLICATION_RESTRICTIONS_CHANGED in your running activities or services, after you’ve checked for new restrictions. This intent is sent only to listeners that are dynamically registered, and not to listeners declared in the app manifest.
  • Unregister while not running—In onPause(), you should unregister for the broadcast of ACTION_APPLICATION_RESTRICTIONS_CHANGED.

COSU Devices

Corporate-owned, single-use devices (COSU) are kiosk devices used for a single purpose, such as digital signage displays, ticket printing kiosks, or checkout registers.

When an Android device is configured as a COSU device, the user sees an application locked to the screen with no Home or Recent Apps buttons to escape the app. COSU can also be configured to show a set of applications, such as a library kiosk with an app for the library catalog and a web browser.

For instructions, see Set up Single-Purpose Devices.

Set up Single Sign-on with Chrome Custom Tabs

Enterprise users often have multiple apps on their device, and they prefer to sign in once to access all of their work applications. Typically, users sign in through a WebView; however, there are a couple reasons why this isn’t ideal:

  1. Users often need to sign in multiple times with the same credentials. The WebView solution often isn’t a true Single Sign-On (SSO) experience.
  2. There can be security risks, including malicious applications inspecting cookies or injecting JavaScript® to access a user’s credentials. Even trusted developers are at risk if they rely on potentially malicious third-party SDKs.

A solution to both problems is to authenticate users using browser Custom Tabs, instead of WebView. This ensures that authentication:

  • Occurs in a secure context (the system browser) where the host app cannot inspect contents.
  • Has a shared cookie state, ensuring the user has to sign in only once.

Requirements

Custom Tabs are supported back to API level 15 (Android 4.0.3). To use Custom Tabs you need a supported browser, such as Chrome. Chrome 45 and later implement this feature as Chrome Custom Tabs.

How do I implement SSO with Custom Tabs?

Google has open sourced an OAuth client library that uses Custom Tabs, contributing it to the OpenID Connect working group of the OpenID Foundation. To set up Custom Tabs for SSO with the AppAuth library, see the documentation and sample code on GitHub, or try the codelab.

Test your App with Android in the enterprise

Once you’ve developed your app, you’ll want to test it in a work profile—both as a profile owner and device owner. See the instructions below.

Use TestDPC to test your Android app

TestDPC is a tool you can use to test your Android app in a variety of enterprise environments. You can configure it as a profile owner or a device owner to launch management APIs on your device, using one of these methods:

  • Download the source code for TestDPC from GitHub.
  • Install TestDPC directly from Google Play.

For more information on how to configure TestDPC, see the instructions below and the TestDPC User Guide.

REQUIRED: Your test Android device needs to run Android 5.0 or later and be able to natively support Android enterprise.

Provision a profile owner

To test your app in a work profile, you need to first provision a profile owner on the TestDPC app:

  1. Launch the TestDPC app and click Set up profile.
  2. When prompted, click Set up, ensuring the TestDPC’s logo is highlighted on the screen.
  3. If your device isn’t encrypted, you need to encrypt your device. Follow the briefcase notification after reboot to continue provisioning.Once you’ve provisioned the profile owner correctly, badged applications appear at the end of your app tray. Install your app on the device and test to see how it runs in the work profile.
  4. Install your app on the device and test to see how it runs in the work profile.

Caution: When running your app with Instant Run in Android Studio, attempting to open your app with a work profile or secondary profile will crash your app. To use your app with the work profile, we recommend you create a new run configuration that includes the --user user_id flag, specifying the work profile user ID. You can find the user ID by executing adb shell pm list users from command line. For more information, see the Instant Run documentation.

Provision a device owner

Testing your app as a device owner requires more steps than testing as a profile owner. You first need to provision the device owner on your test device using the NfcProvisioning sample app. For complete instructions to provision TestDPC in device owner mode using the NfcProvisioning app, see the TestDPC User Guide.

  1. Download the NfcProvisioning app sample files to your development environment.
  2. Unpack the project, open your shell, and cd to the project directory.
  3. Add a file to the directory with the local.properties name and the following content: sdk.dir=/path/to/your/android/sdk
  4. While in the project directory, enter these commands to build the NfcProvisioning APK: ./gradlew init ./gradlew build The NfcProvisioning APK you need is now located in ./Application/build/outputs/apk.
  5. Install the APK on your programmer device, which you can use to provision other devices.
  6. Create a text file called nfcprovisioning.txt and include the following information: android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME=com.afwsamples.testdpc android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION=https://testdpc-latest-apk.appspot.com android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM=gJD2YwtOiWJHkSMkkIfLRlj-quNqG1fb6v100QmzM9w= # note: checksum must be URL-safe android.app.extra.PROVISIONING_LOCALE=en_US android.app.extra.PROVISIONING_TIME_ZONE=America/New_York

    Note: If you’re developing for Android 5.0 Lollipop, see the instructions in the TestDPC User Guide.

  7. Push that text file to your programmer device by entering: adb push <path-to-nfcprovisioning.txt> /sdcard/
  8. Ensure that the programmer device is connected to Wi-Fi on either an unsecured or WPA2 secured network.

    The NFC Provisioning app will automatically pass those Wi-Fi credentials onto the target device.

  9. Open the NFC Provisioning app and ensure com.google.android.testdpc is auto-populated.
  10. Bump the devices to transfer the data.
  11. Follow the onscreen instructions to set up your target device.
  12. Once you’ve completed provisioning the device owner, you can test your app on that device. You should specifically test how managed configurations, URIs, and intents work on that device.

End-to-end testing

After you’ve finished testing your app in the environments above, you’ll likely want to test your app in an end-to-end production environment. This process includes the steps a customer needs to take to deploy your app in their organization, including:

  • App distribution through Play
  • Server-side managed configuration
  • Server-side profile policy control

You need to access an EMM console to complete the end-to-end testing. The easiest way to get one is to request a testing console from your EMM. Once you have access, complete these tasks:

  1. Create a test version of your application with a new ApplicationId.
  2. Claim a managed Google domain and bind it to your EMM. If you already have a testing domain that’s bound to an EMM, you may need to unbind it to test it with your preferred EMM. Please consult your EMM for the specific unbinding steps.
  3. Publish your application to the private channel for their managed Google domain.
  4. Use the EMM console and EMM application to:
    1. Set up work devices.
    2. Distribute your application.
    3. Set managed configuration.
    4. Set device policies.

This process will differ based on your EMM. Please consult your EMM’s documentation for further details. Congrats! You’ve completed these steps and verified that your app works well with Android in the enterprise.

Learn about Android DevHub.

developer.android.com

Android, the world's most popular mobile platform

Android powers hundreds of millions of mobile devices in more than 190 countries around the world. It's the largest installed base of any mobile platform and growing fast—every day another million users power up their Android devices for the first time and start looking for apps, games, and other digital content.

Android gives you a world-class platform for creating apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

Global partnerships and large installed base

Building on the contributions of the open-source Linux community and more than 300 hardware, software, and carrier partners, Android has rapidly become the fastest-growing mobile OS.

Every day more than a million new Android devices are activated worldwide.

Android’s openness has made it a favorite for consumers and developers alike, driving strong growth in app consumption. Android users download billions of apps and games from Google Play each month.

With its partners, Android is continuously pushing the boundaries of hardware and software forward to bring new capabilities to users and developers. For developers, Android innovation lets you build powerful, differentiated applications that use the latest mobile technologies.

Rapid innovation

Android is continuously pushing the boundaries of hardware and software forward, to bring new capabilities to users and developers. For developers, the rapid evolution of Android technology lets you stay in front with powerful, differentiated applications.

Android gives you access to the latest technologies and innovations across a multitude of device form-factors, chipset architectures, and price points. From multicore processing and high-performance graphics to state-of-the-art sensors, vibrant touchscreens, and emerging mobile technologies.

Powerful development framework

Easily optimize a single binary for phones, tablets, and other devices.

Android gives you everything you need to build best-in-class app experiences. It gives you a single application model that lets you deploy your apps broadly to hundreds of millions of users across a wide range of devices—from phones to tablets and beyond.

Android also gives you tools for creating apps that look great and take advantage of the hardware capabilities available on each device. It automatically adapts your UI to look its best on each device, while giving you as much control as you want over your UI on different device types.

For example, you can create a single app binary that's optimized for both phone and tablet form factors. You declare your UI in lightweight sets of XML resources, one set for parts of the UI that are common to all form factors and other sets for optimzations specific to phones or tablets. At runtime, Android applies the correct resource sets based on its screen size, density, locale, and so on.

To help you develop efficiently, the Android Developer Tools offer a full Java IDE with advanced features for developing, debugging, and packaging Android apps. Using the IDE, you can develop on any available Android device or create virtual devices that emulate any hardware configuration.

Billion downloads a month and growing. Get your apps in front of millions of users at Google's scale.

Open marketplace for distributing your apps

Google Play is the premier marketplace for selling and distributing Android apps. When you publish an app on Google Play, you reach the huge installed base of Android.

As an open marketplace, Google Play puts you in control of how you sell your products. You can publish whenever you want, as often as you want, and to the customers you want. You can distribute broadly to all markets and devices or focus on specific segments, devices, or ranges of hardware capabilities.

You can monetize in the way that works best for your business—priced or free, with in-app products or subscriptions—for highest engagement and revenues. You also have complete control of the pricing for your apps and in-app products and can set or change prices in any supported currency at any time.

Beyond growing your customer base, Google Play helps you build visibility and engagement across your apps and brand. As your apps rise in popularity, Google Play gives them higher placement in weekly "top" charts and rankings, and for the best apps promotional slots in curated collections.

Preinstalled on billions of Android devices around the world, Google Play can be a growth engine for your business.

developer.android.com

Android Lollipop | Android Developers

Welcome to Android 5.0 Lollipop—the largest and most ambitious release for Android yet!

This release is packed with new features for users and thousands of new APIs for developers. It extends Android even further, from phones, tablets, and wearables, to TVs and cars.

For a closer look at the new developer APIs, see the Android 5.0 API Overview. Or, read more about Android 5.0 for consumers at www.android.com.

Note: The Android 5.1 Lollipop MR1 update is available with additional features and fixes. For more information, see the Android 5.1 API Overview.

Material design

Android 5.0 brings Material design to Android and gives you an expanded UI toolkit for integrating the new design patterns easily in your apps.

New 3D views let you set a z-level to raise elements off of the view hierarchy and cast realtime shadows, even as they move.

Built-in activity transitions take the user seamlessly from one state to another with beautiful, animated motion. The material theme adds transitions for your activities, including the ability to use shared visual elements across activities.

To replay the movie, click on the device screen

Ripple animations are available for buttons, checkboxes, and other touch controls in your app.

You can also define vector drawables in XML and animate them in a variety of ways. Vector drawables scale without losing definition, so they are perfect for single-color in-app icons.

A new system-managed processing thread called RenderThread keeps animations smooth even when there are delays in the main UI thread.

Performance focus

Android 5.0 provides a faster, smoother and more powerful computing experience.

Android now runs exclusively on the new ART runtime, built from the ground up to support a mix of ahead-of-time (AOT), just-in-time (JIT), and interpreted code. It’s supported on ARM, x86, and MIPS architectures and is fully 64-bit compatible.

ART improves app performance and responsiveness. Efficient garbage collection reduces the number and duration of pauses for GC events, which fit comfortably within the v-sync window so your app doesn’t skip frames. ART also dynamically moves memory to optimize performance for foreground uses.

Android 5.0 introduces platform support for 64-bit architectures—used by the Nexus 9's NVIDIA Tegra K1. Optimizations provide larger address space and improved performance for certain compute workloads. Apps written in the Java language run as 64-bit apps automatically—no modifications are needed. If your app uses native code, we’ve extended the NDK to support new ABIs for ARM v8, and x86-64, and MIPS-64.

Continuing the focus on smoother performance, Android 5.0 offers improved A/V sync. The audio and graphics pipelines have been instrumented for more accurate timestamps, enabling video apps and games to display smooth synchronized content.

Notifications

Notifications in Android 5.0 are more visible, accessible, and configurable.

Varying notification details may appear on the lock screen if desired by the user. Users may elect to allow none, some, or all notification content to be shown on a secure lock screen.

Key notification alerts such as incoming calls appear in a heads-up notification—a small floating window that allows the user to respond or dismiss without leaving the current app.

You can now add new metadata to notifications to collect associated contacts (for ranking), category, and priority.

A new media notification template provides consistent media controls for notifications with up to 6 action buttons, including custom controls such as "thumbs up"—no more need for RemoteViews!

Your apps on the big screen

Android TV provides a complete TV platform for your app's big screen experience. Android TV is centered around a simplified home screen experience that allows users to discover content easily, with personalized recommendations and voice search.

With Android TV you can now create big, bold experiences for your app or game content and support interactions with game controllers and other input devices. To help you build cinematic, 10-foot UIs for television, Android provides a leanback UI framework in the v17 support library.

The Android TV Input Framework (TIF) allows TV apps to handle video streams from sources such as HDMI inputs, TV tuners, and IPTV receivers. It also enables live TV search and recommendations via metadata published by the TV Input and includes an HDMI-CEC Control Service to handle multiple devices with a single remote.

The TV Input Framework provides access to a wide variety of live TV input sources and brings them together in a single user interface for users to browse, view, and enjoy content. Building a TV input service for your content can help make your content more accessible on TV devices.

Document-centric apps

Document-centric recents.

Android 5.0 introduces a redesigned Overview space (formerly called Recents) that’s more versatile and useful for multitasking.

New APIs allow you to show separate activities in your app as individual documents alongside other recent screens.

You can take advantage of concurrent documents to provide users instant access to more of your content or services. For example, you might use concurrent documents to represent files in a productivity app, player matches in a game, or chats in a messaging app.

Advanced connectivity

Android 5.0 adds new APIs that allow apps to perform concurrent operations with Bluetooth Low Energy (BLE), allowing both scanning (central mode) and advertising (peripheral mode).

New multi-networking features allow apps to query available networks for available features such as whether they are Wi-Fi, cellular, metered, or provide certain network features. Then the app can request a connection and respond to connectivity loss or other network changes.

NFC APIs now allow apps to register an NFC application ID (AID) dynamically. They can also set the preferred card emulation service per active service and create an NDEF record containing UTF-8 text data.

High-performance graphics

Support for Khronos OpenGL ES 3.1 now provides games and other apps the highest-performance 2D and 3D graphics capabilities on supported devices.

Gameloft's Rival Knights uses ASTC (Adaptive Scalable Texture Compression) from AEP and Compute Shaders from ES 3.1 to deliver HDR (High Dynamic Range) Bloom effects and provide more graphical detail.

OpenGL ES 3.1 adds compute shaders, stencil textures, accelerated visual effects, high quality ETC2/EAC texture compression, advanced texture rendering, standardized texture size and render-buffer formats, and more.

Android 5.0 also introduces the Android Extension Pack (AEP), a set of OpenGL ES extensions that give you access to features like tessellation shaders, geometry shaders, ASTC texture compression, per-sample interpolation and shading, and other advanced rendering capabilities. With AEP you can deliver high-performance graphics across a range of GPUs.

More powerful audio

A new audio-capture design offers low-latency audio input. The new design includes: a fast capture thread that never blocks except during a read; fast track capture clients at native sample rate, channel count, and bit depth; and normal capture clients offer resampling, up/down channel mix, and up/down bit depth.

Multi-channel audio stream mixing allows professional audio apps to mix up to eight channels including 5.1 and 7.1 channels.

Apps can expose their media content and browse media from other apps, then request playback. Content is exposed through a queryable interface and does not need to reside on the device.

Apps have finer-grain control over text-to-speech synthesis through voice profiles that are associated with specific locales, quality and latency rating. New APIs also improve support for synthesis error checking, network synthesis, language discovery, and network fallback.

Android now includes support for standard USB audio peripherals, allowing users to connect USB headsets, speakers, microphones, or other high performance digital peripherals. Android 5.0 also adds support for Opus audio codecs.

New MediaSession APIs for controlling media playback now make it easier to provide consistent media controls across screens and other controllers.

Enhanced camera & video

Android 5.0 introduces all new camera APIs that let you capture raw formats such as YUV and Bayer RAW, and control parameters such as exposure time, ISO sensitivity, and frame duration on a per-frame basis. The new fully-synchronized camera pipeline allows you to capture uncompressed full-resolution YUV images at 30 FPS on supported devices.

In addition to giving greater control over image capture, the new APIs also expose detailed information about the camera's properties and capabilities and provide metadata that describes the capture settings of each frame.

Apps sending video streams over the network can now take advantage of H.265 High Efficiency Video Coding (HEVC) for optimized encoding and decoding of video data.

Android 5.0 also adds support for multimedia tunneling to provide the best experience for ultra-high definition (4K) content and the ability to play compressed audio and video data together.

Android in the workplace

Users have a unified view of their personal and work apps, which are badged for easy identification.

To enable bring-your-own-device for enterprise environments, a new managed provisioning process creates a secure work profile on the device. In the launcher, apps are shown with a Work badge to indicate that the app and its data are administered inside of the work profile by an IT administrator.

Notifications for both the personal and work profile are visible in a unified view. The data for each profile is always kept separate and secure from each other, including when the same app is used by both profiles.

For company-owned devices, IT administrators can start with a new device and configure it with a device owner. Employers can issue these devices with a device owner app already installed that can configure global device settings.

Screen capturing and sharing

Android 5.0 lets you add screen capturing and screen sharing capabilities to your app.

With user permission, you can capture non-secure video from the display and deliver it over the network if you choose.

New types of sensors

In Android 5.0, a new tilt detector sensor helps improve activity recognition on supported devices, and a heart rate sensor reports the heart rate of the person touching the device.

New interaction composite sensors are now available to detect special interactions such as a wake up gesture, a pick up gesture, and a glance gesture.

Chromium WebView

The initial release for Android 5.0 includes a version of Chromium for WebView based on the Chromium M37 release, adding support for WebRTC, WebAudio, and WebGL.

Chromium M37 also includes native support for all of the Web Components specifications: Custom Elements, Shadow DOM, HTML Imports, and Templates. This means you can use Polymer and its material design elements in a WebView without needing polyfills.

Although WebView has been based on Chromium since Android 4.4, the Chromium layer is now updatable from Google Play.

As new versions of Chromium become available, users can update from Google Play to ensure they get the latest enhancements and bug fixes for WebView, providing the latest web APIs and bug fixes for apps using WebView on Android 5.0 and higher.

Accessibility & input

New accessibility APIs can retrieve detailed information about the properties of windows on the screen that sighted users can interact with and define standard or customized input actions for UI elements.

New Input method editor (IME) APIs enable faster switching to other IMEs directly from the input method.

Tools for building battery-efficient apps

New job scheduling APIs allow you optimize battery life by deferring jobs for the system to run at a later time or under specified conditions, such as when the device is charging or connected to Wi-Fi.

A new dumpsys batterystats command generates battery usage statistics that you can use to understand system-wide power use and understand the impact of your app on the device battery. You can look at a history of power events, approximate power use per UID and system component, and more.

Battery Historian is a new tool to convert the statistics from dumpsys batterystats into a visualization for battery-related debugging. You can find it at https://github.com/google/battery-historian.

developer.android.com

Package Index | Android Developers

android

Contains resource classes used by applications included in the platform and defines application permissions for system features.

android.accessibilityservice

The classes in this package are used for development of accessibility service that provide alternative or augmented feedback to the user.

android.accounts android.animation

These classes provide functionality for the property animation system, which allows you to animate object properties of any type. int, float, and hexadecimal color values are supported by default. You can animate any other type by telling the system how to calculate the values for that given type with a custom TypeEvaluator.

For more information, see the Animation guide.

android.annotation android.app

Contains high-level classes encapsulating the overall Android application model.

android.app.admin

Provides device administration features at the system level, allowing you to create security-aware applications that are useful in enterprise settings, in which IT professionals require rich control over employee devices.

For more information, see the Device Administration guide.

android.app.assist android.app.backup

Contains the backup and restore functionality available to applications. If a user wipes the data on their device or upgrades to a new Android-powered device, all applications that have enabled backup can restore the user's previous data when the application is reinstalled.

For more information, see the Data Backup guide.

android.app.job android.app.usage android.appwidget

Contains the components necessary to create "app widgets", which users can embed in other applications (such as the home screen) to quickly access application data and services without launching a new activity.

For more information, see the App Widgets guide.

android.bluetooth

Provides classes that manage Bluetooth functionality, such as scanning for devices, connecting with devices, and managing data transfer between devices. The Bluetooth API supports both "Classic Bluetooth" and Bluetooth Low Energy.

For more information about Classic Bluetooth, see the Bluetooth guide. For more information about Bluetooth Low Energy, see the Bluetooth Low Energy (BLE) guide.

android.bluetooth.le android.companion android.content

Contains classes for accessing and publishing data on a device.

android.content.pm

Contains classes for accessing information about an application package, including information about its activities, permissions, services, signatures, and providers.

android.content.res

Contains classes for accessing application resources, such as raw asset files, colors, drawables, media or other other files in the package, plus important device configuration details (orientation, input types, etc.) that affect how the application may behave.

For more information, see the Application Resources guide.

android.database Contains classes to explore data returned through a content provider. android.database.sqlite Contains the SQLite database management classes that an application would use to manage its own private database. android.databinding

Contains components used when developing applications with data binding.

android.drm

Provides classes for managing DRM content and determining the capabilities of DRM plugins (agents).

android.gesture Provides classes to create, recognize, load and save gestures. android.graphics Provides low level graphics tools such as canvases, color filters, points, and rectangles that let you handle drawing to the screen directly. android.graphics.drawable

Provides classes to manage a variety of visual elements that are intended for display only, such as bitmaps and gradients.

android.graphics.drawable.shapes Contains classes for drawing geometric shapes. android.graphics.fonts android.graphics.pdf Contains classes for manipulation of PDF content. android.hardware

Provides support for hardware features, such as the camera and other sensors.

android.hardware.camera2

The android.hardware.camera2 package provides an interface to individual camera devices connected to an Android device.

android.hardware.camera2.params android.hardware.display android.hardware.fingerprint android.hardware.input android.hardware.usb

Provides support to communicate with USB hardware peripherals that are connected to Android-powered devices.

For more information, see the USB guide.

android.icu.lang android.icu.math android.icu.text android.icu.util android.inputmethodservice Base classes for writing input methods (such as software keyboards). android.location

Contains the framework API classes that define Android location-based and related services.

android.media Provides classes that manage various media interfaces in audio and video. android.media.audiofx Provides classes that manage audio effects implemented in the media framework. android.media.browse android.media.effect

Provides classes that allow you to apply a variety of visual effects to images and videos.

android.media.midi

Provides classes for sending and receiving messages using the standard MIDI event protocol over USB, Bluetooth LE, and virtual (inter-app) transports.

android.media.projection android.media.session android.media.tv android.mtp

Provides APIs that let you interact directly with connected cameras and other devices, using the PTP (Picture Transfer Protocol) subset of the MTP (Media Transfer Protocol) specification.

android.net Classes that help with network access, beyond the normal java.net.* APIs. android.net.http android.net.nsd android.net.rtp

Provides APIs for RTP (Real-time Transport Protocol), allowing applications to manage on-demand or interactive data streaming.

android.net.sip

Provides access to Session Initiation Protocol (SIP) functionality, such as making and answering VOIP calls using SIP.

For more information, see the Session Initiation Protocol developer guide.

android.net.wifi

Provides classes to manage Wi-Fi functionality on the device.

android.net.wifi.aware

Provides classes which allow applications to use Wi-Fi Aware to discover peers and create connections to them.

android.net.wifi.hotspot2 android.net.wifi.hotspot2.omadm android.net.wifi.hotspot2.pps android.net.wifi.p2p

Provides classes to create peer-to-peer (P2P) connections with Wi-Fi Direct.

android.net.wifi.p2p.nsd android.nfc

Provides access to Near Field Communication (NFC) functionality, allowing applications to read NDEF message in NFC tags. A "tag" may actually be another device that appears as a tag.

For more information, see the Near Field Communication guide.

android.nfc.cardemulation android.nfc.tech

These classes provide access to a tag technology's features, which vary by the type of tag that is scanned.

android.opengl

Provides an OpenGL ES static interface and utilities.

android.os Provides basic operating system services, message passing, and inter-process communication on the device. android.os.health The android.os.health package contains a set of classes to provide data to track the system resources of applications. android.os.storage

Contains classes for the system storage service, which manages binary asset filesystems known as Opaque Binary Blobs (OBBs).

android.preference Provides classes that manage application preferences and implement the preferences UI. android.print

Overview

Provides classes for implementing print support in applications and also contains all base classes and abstractions involved in printing.

android.print.pdf android.printservice

Provides classes for implementing print services.

android.provider

Provides convenience classes to access the content providers supplied by Android.

android.renderscript

RenderScript provides support for high-performance computation across heterogeneous processors.

For more information, see the RenderScript developer guide.

android.sax A framework that makes it easy to write efficient and robust SAX handlers. android.security

Provides access to a few facilities of the Android security subsystems.

android.security.keystore android.service.autofill android.service.carrier android.service.chooser android.service.dreams android.service.media android.service.notification android.service.quicksettings android.service.restrictions android.service.textservice

Provides classes that allow you to create spell checkers in a manner similar to the input method framework (for IMEs).

android.service.voice android.service.vr android.service.wallpaper android.speech android.speech.tts android.support.animation android.support.annotation android.support.app.recommendation android.support.compat android.support.coreui android.support.coreutils android.support.customtabs android.support.design android.support.design.widget android.support.dynamicanimation android.support.exifinterface android.support.fragment android.support.graphics.drawable android.support.graphics.drawable.animated android.support.media android.support.media.tv android.support.mediacompat android.support.multidex android.support.percent android.support.recommendation android.support.text.emoji android.support.text.emoji.bundled android.support.text.emoji.widget android.support.transition Support android.transition classes to provide transition API back to android API level 14. android.support.v13 android.support.v13.app Support classes to access some of the android.app package features introduced after API level 13 in a backwards compatible fashion. android.support.v13.view android.support.v13.view.inputmethod android.support.v14.preference android.support.v17.leanback

Support classes for building Leanback user experiences.

android.support.v17.leanback.app

Support classes providing high level Leanback user interface building blocks: fragments and helpers.

android.support.v17.leanback.database android.support.v17.leanback.graphics android.support.v17.leanback.media android.support.v17.leanback.system android.support.v17.leanback.widget

Support classes providing low level Leanback user interface building blocks: widgets and helpers.

android.support.v17.leanback.widget.picker android.support.v17.preference android.support.v4 android.support.v4.accessibilityservice Support android.accessibilityservice classes to assist with development of applications for android API level 4 or later. android.support.v4.app android.support.v4.content Support android.content classes to assist with development of applications for android API level 4 or later. android.support.v4.content.pm Support android.content.pm classes to assist with development of applications for android API level 4 or later. android.support.v4.content.res android.support.v4.database Support android.database classes to assist with development of applications for android API level 4 or later. android.support.v4.graphics android.support.v4.graphics.drawable android.support.v4.hardware.display android.support.v4.hardware.fingerprint android.support.v4.math android.support.v4.media android.support.v4.media.session android.support.v4.net android.support.v4.os Support android.os classes to assist with development of applications for android API level 4 or later. android.support.v4.print android.support.v4.provider android.support.v4.text android.support.v4.text.util android.support.v4.util Support android.util classes to assist with development of applications for android API level 4 or later. android.support.v4.utils android.support.v4.view Support android.util classes to assist with development of applications for android API level 4 or later. android.support.v4.view.accessibility Support classes to access some of the android.view.accessibility package features introduced after API level 4 in a backwards compatible fashion. android.support.v4.view.animation android.support.v4.widget Support android.widget classes to assist with development of applications for android API level 4 or later. android.support.v7.app android.support.v7.appcompat android.support.v7.cardview android.support.v7.content.res android.support.v7.graphics android.support.v7.graphics.drawable android.support.v7.gridlayout android.support.v7.media

Contains APIs that control the routing of media channels and streams from the current device to external speakers and destination devices.

android.support.v7.mediarouter android.support.v7.palette android.support.v7.preference android.support.v7.recyclerview android.support.v7.util android.support.v7.view android.support.v7.widget android.support.v7.widget.helper android.support.v7.widget.util android.support.v8.renderscript android.support.wear android.support.wear.widget android.support.wear.widget.drawer android.system android.telecom The Android Telecom framework is responsible for managing calls on an Android device. android.telephony Provides APIs for monitoring the basic phone information, such as the network type and connection state, plus utilities for manipulating phone number strings. android.telephony.cdma Provides APIs for utilizing CDMA-specific telephony features. android.telephony.gsm Provides APIs for utilizing GSM-specific telephony features, such as text/data/PDU SMS messages. android.test

A framework for writing Android test cases and suites.

For more information, see the Testing developer guide.

android.test.mock

Utility classes providing stubs or mocks of various Android framework building blocks.

For more information, see the Testing guide.

android.test.suitebuilder Utility classes supporting the test runner classes. android.test.suitebuilder.annotation Utility classes supporting the test runner classes. android.text

Provides classes used to render or track text and text spans on the screen.

android.text.format This package contains alternative classes for some text formatting classes defined in java.util and java.text. android.text.method

Provides classes that monitor or modify keypad input.

android.text.style

Provides classes used to view or change the style of a span of text in a View object.

android.text.util Utilities for converting identifiable text strings into clickable links and creating RFC 822-type message (SMTP) tokens. android.transition

The classes in this package enable "scenes & transitions" functionality for view hiearchies.

android.util Provides common utility methods such as date/time manipulation, base64 encoders and decoders, string and number conversion methods, and XML utilities. android.view Provides classes that expose basic user interface classes that handle screen layout and interaction with the user. android.view.accessibility

The classes in this package are used to represent screen content and changes to it as well as APIs for querying the global accessibility state of the system.

android.view.animation

Provides classes that handle tweened animations.

android.view.autofill android.view.inputmethod Framework classes for interaction between views and input methods (such as soft keyboards). android.view.textclassifier android.view.textservice android.webkit

Provides tools for browsing the web.

android.widget

The widget package contains (mostly visual) UI elements to use on your Application screen.

com.android.test.runner dalvik.annotation dalvik.bytecode dalvik.system java.awt.font java.beans java.io Provides for system input and output through data streams, serialization and the file system. java.lang Provides classes that are fundamental to the design of the Java programming language. java.lang.annotation Provides library support for the Java programming language annotation facility. java.lang.invoke java.lang.ref Provides reference-object classes, which support a limited degree of interaction with the garbage collector. java.lang.reflect Provides classes and interfaces for obtaining reflective information about classes and objects. java.math java.net Provides the classes for implementing networking applications. java.nio Defines buffers, which are containers for data, and provides an overview of the other NIO packages. java.nio.channels Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations. java.nio.channels.spi Service-provider classes for the java.nio.channels package. java.nio.charset Defines charsets, decoders, and encoders, for translating between bytes and Unicode characters. java.nio.charset.spi Service-provider classes for the java.nio.charset package. java.nio.file java.nio.file.attribute java.nio.file.spi java.security Provides the classes and interfaces for the security framework. java.security.acl The classes and interfaces in this package have been superseded by classes in the java.security package. java.security.cert Provides classes and interfaces for parsing and managing certificates, certificate revocation lists (CRLs), and certification paths. java.security.interfaces Provides interfaces for generating RSA (Rivest, Shamir and Adleman AsymmetricCipher algorithm) keys as defined in the RSA Laboratory Technical Note PKCS#1, and DSA (Digital Signature Algorithm) keys as defined in NIST's FIPS-186. java.security.spec Provides classes and interfaces for key specifications and algorithm parameter specifications. java.sql Provides the API for accessing and processing data stored in a data source (usually a relational database) using the JavaTM programming language. java.text Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages. java.time

The main API for dates, times, instants, and durations.

java.time.chrono

Generic API for calendar systems other than the default ISO.

java.time.format

Provides classes to print and parse dates and times.

java.time.temporal

Access to date and time using fields and units, and date time adjusters.

java.time.zone

Support for time-zones and their rules.

java.util Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array). java.util.concurrent Utility classes commonly useful in concurrent programming. java.util.concurrent.atomic A small toolkit of classes that support lock-free thread-safe programming on single variables. java.util.concurrent.locks Interfaces and classes providing a framework for locking and waiting for conditions that is distinct from built-in synchronization and monitors. java.util.function Functional interfaces provide target types for lambda expressions and method references. java.util.jar Provides classes for reading and writing the JAR (Java ARchive) file format, which is based on the standard ZIP file format with an optional manifest file. java.util.logging

Provides the classes and interfaces of the JavaTM 2 platform's core logging facilities.

java.util.prefs This package allows applications to store and retrieve user and system preference and configuration data. java.util.regex Classes for matching character sequences against patterns specified by regular expressions. java.util.stream Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections. java.util.zip Provides classes for reading and writing the standard ZIP and GZIP file formats. javax.crypto Provides the classes and interfaces for cryptographic operations. javax.crypto.interfaces Provides interfaces for Diffie-Hellman keys as defined in RSA Laboratories' PKCS #3. javax.crypto.spec Provides classes and interfaces for key specifications and algorithm parameter specifications. javax.microedition.khronos.egl javax.microedition.khronos.opengles

Provides a standard OpenGL interface.

javax.net Provides classes for networking applications. javax.net.ssl Provides classes for the secure socket package. javax.security.auth This package provides a framework for authentication and authorization. javax.security.auth.callback This package provides the classes necessary for services to interact with applications in order to retrieve information (authentication data including usernames or passwords, for example) or to display information (error and warning messages, for example). javax.security.auth.login This package provides a pluggable authentication framework. javax.security.auth.x500 This package contains the classes that should be used to store X500 Principal and X500 Private Credentials in a Subject. javax.security.cert Provides classes for public key certificates. javax.sql Provides the API for server side data source access and processing from the JavaTM programming language. javax.xml javax.xml.datatype javax.xml.namespace javax.xml.parsers javax.xml.transform javax.xml.transform.dom javax.xml.transform.sax javax.xml.transform.stream javax.xml.validation javax.xml.xpath junit.framework junit.runner Utility classes supporting the junit test framework. org.apache.http.conn org.apache.http.conn.scheme org.apache.http.conn.ssl TLS/SSL specific parts of the HttpConn API. org.apache.http.params org.json org.w3c.dom org.w3c.dom.ls org.xml.sax org.xml.sax.ext org.xml.sax.helpers org.xmlpull.v1 org.xmlpull.v1.sax2

developer.android.com

Material Design for Developers | Android Developers

Dependencies and Prerequisites

  • Android 5.0 (API level 21)

Material design is a comprehensive guide for visual, motion, and interaction design across platforms and devices. To use material design in your Android apps, follow the guidelines described in the material design specification and use the new components and functionality available in Android 5.0 (API level 21).

You can also use the Design Support library to integrate additional material design components and patterns into your applications to complement the components available in the Android framework. The Design Support library is compatible with Android 2.3 (API level 9) and above.

This class shows you how to create material design apps with the following elements:

  • The material theme
  • Widgets for cards and lists
  • Custom shadows and view clipping
  • Vector drawables
  • Custom animations
  • Widgets for navigation drawers and other components

This class also teaches you how to maintain compatibility with versions of Android earlier than 5.0 (API level 21) when you use material design features in your app.

Lessons

Getting Started Learn how to update your app with material design features. Using the Material Theme Learn how to apply material design styles to your app. Creating Lists and Cards Learn how to create lists and cards with a consistent look and feel using system widgets. Defining Shadows and Clipping Views Learn how to set elevation for your views to create custom shadows and how to clip views. Working with Drawables Learn how to create vector drawables and how to tint drawable resources. Defining Custom Animations Learn how to create custom animations for views and activity transitions with shared elements. Maintaining Compatibility Learn how to maintain compatibility with platform versions earlier than Android 5.0. Selecting Colors with the Palette API Learn how to select colors for your app using the v7 Palette library. Using the Design Support library Learn how to create components from the Design Support library including the navigation drawer.

Video Training

If you prefer to learn through interactive video training, check out this online course about material design for Android developers.

Start the video course

This site uses cookies to store your preferences for site-specific language and display options. OK

You have successfully signed up for the latest Android developer news and tips.

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

developer.android.com


Смотрите также