Additionally, the AutofillManager class includes the notifyViewVisibilityChanged View, int, boolean method that you can call to notify the framework about changes in the visibility of a view in a virtual structure. There's also an overload of the method for non virtual structures. However, non virtual structures usually don't require you to explicitly notify the framework because the method is already called by the View class.
Custom descriptions are useful to help the autofill service clarify what is being saved; for example, when the screen contains a credit card, it could display a logo of the credit card bank, the last four digits of the credit card number, and its expiration number. To learn more, see the CustomDescription class. Validator objects are used to avoid displaying the autofill save UI when the Validator condition isn't satisfied.
This change is backward-compatible, as Editable implements CharSequence. The Editable interface provides valuable additional functionality. For example, because Editable also implements the Spannable interface, you can apply markup to content within an instance of EditText.
By default, the WebView shows an interstitial that warns users of the known threat. This screen gives users the option to load the URL anyway or return to a previous page that's safe. Note: For optimal protection against known threats, wait until you've initialized Safe Browsing before you invoke a WebView object's loadUrl method.
The following code snippets show how you can instruct your app's instances of WebView to always go back to safety after encountering a known threat:. The MediaMetadataRetriever class has a new method, getScaledFrameAtTime , that finds a frame near a given time position and returns a bitmap with the same aspect ratio as the source frame, but scaled to fit into a rectangle of given width and height.
This is useful for generating thumbnail images from video. We recommend using this method rather than getFrameAtTime which can waste memory because it returns a bitmap with the same resolution as the source video. For example, a frame from a 4K video would be a 16MB bitmap, far larger than you would need for a thumbnail image.
This class allows you to create, map, and manage an anonymous SharedMemory instance. ASharedMemory gives access to a file descriptor, which can then be mapped to read and write. This notification cannot be dismissed like other notifications. To remove the notification, the service must be either stopped or removed from the "foreground" state.
For more information read Running a service in the foreground. And if you are building a media player, also read Using MediaStyle notifications with a foreground service. Beginning with Android 8. If your app posts multiple notifications in one second, they all appear as expected, but only the first notification per second makes a sound.
However, Android also applies a rate limit when updating a notification. If you post updates to a single notification too frequently many in less than one second , the system might drop some updates.
Since Android 1. NotificationCompat is updated as the platform evolves to include the latest methods. It is important to note that the availability of a method in NotificationCompat does not guarantee that the corresponding feature will be provided on older devices. In some cases calling a newly-introduced API results in a no-op on older devices. For example, NotificationCompat. Content and code samples on this page are subject to the licenses described in the Content License. App Basics. Build your first app.
App resources. Resource types. App manifest file. Device compatibility. Multiple APK support. Tablets, large screens, and foldables. Build responsive UIs. Build for foldables. Getting started. Handling data. User input. Watch Face Studio. Health services. Creating watch faces. Android TV. Build TV Apps. Build TV playback apps. Help users find content on TV. Recommend TV content. Watch Next. Build TV games. Build TV input services. TV Accessibility.
Android for Cars. Build media apps for cars. Build navigation, parking, and charging apps for cars. Android Things.
Supported hardware. Advanced setup. Build apps. Create a Things app. Communicate with wireless devices. Configure devices. Interact with peripherals. Build user-space drivers. Manage devices. Create a build. Push an update. Chrome OS devices. App architecture. Architecture Components. UI layer libraries. View binding. Data binding library. Lifecycle-aware components. Paging Library.
Paging 2. Data layer libraries. How-To Guides. Advanced Concepts. Threading in WorkManager. App entry points. App shortcuts. App navigation. Navigation component. App links. Dependency injection. Core topics. App compatibility. Interact with other apps. Package visibility. Intents and intent filters. User interface.
Add motion to your layout with MotionLayout. MotionLayout XML reference. Improving layout performance. Custom view components. Look and feel. Splash screens. Add the app bar. Control the system UI visibility.
Supporting swipe-to-refresh. Pop-up messages overview. Adding search functionality. Creating backward-compatible UIs. Home channels for mobile apps.
App widgets. Media app architecture. Building an audio app. Building a video app. The Google Assistant. Routing between devices. Background tasks.
Manage device awake state. Save to shared storage. If device implementations support the VoiceInteractionService and have more than one application using this API installed at a time, they:. If device implementations allow launching normal Android Activities on secondary displays, they:.
If device implementations allow launching normal Android Activities on secondary displays and primary and secondary displays have different android. DisplayMetrics :. If device implementations allow launching normal Android Activities on secondary displays and a secondary display has the android.
Managed Dalvik bytecode can call into native code provided in the application. If device implementations provide a complete implementation of the android. Webview API, they:. If device implementations include a standalone Browser application for general web browsing, they:.
The behaviors of each of the API types managed, soft, native, and web must be consistent with the preferred implementation of the upstream Android Open Source Project. Some specific areas of compatibility are:. The above list is not comprehensive. The Compatibility Test Suite CTS tests significant portions of the platform for behavioral compatibility, but not all. It is the responsibility of the implementer to ensure behavioral compatibility with the Android Open Source Project.
Android follows the package and class namespace conventions defined by the Java programming language. To ensure compatibility with third-party applications, device implementers MUST NOT make any prohibited modifications see below to these package namespaces:. Note that the restrictions above correspond to standard conventions for naming APIs in the Java programming language; this section simply aims to reinforce those conventions and make them binding through inclusion in this Compatibility Definition.
See section 7. SHOULD run fuzz tests under various modes of execution and target architectures to assure the stability of the runtime. Note that memory values specified below are considered minimum values and device implementations MAY allocate more memory per application.
Android includes a launcher application home screen and support for third-party applications to replace the device launcher home screen. If device implementations allow third-party applications to replace the device home screen, they:.
If device implementations include a default launcher that supports in-app pinning of shortcuts, they:. If device implementations implement a default launcher that provides quick access to the additional shortcuts provided by third-party apps through the ShortcutManager API, they:. If device implementations include a default launcher app that shows badges for the app icons, they:.
If device implementations support third-party app widgets and in-app pinning of shortcuts, they:. Android includes Notification and NotificationManager APIs that allow third-party app developers to notify users of notable events and attract users' attention using the hardware components e. If device implementations allow third party apps to notify users of notable events , they:. Android includes the NotificationListenerService APIs that allow apps once explicitly enabled by the user to receive a copy of all notifications as they are posted or updated.
If device implementations report the feature flag android. Generally speaking, this functionality consists of a single, system-wide user interface that allows users to enter queries, displays suggestions as users type, and displays results. The Android APIs allow developers to reuse this interface to provide search within their own apps and allow developers to supply results to the common global search user interface.
Android also includes the Assist APIs to allow applications to elect how much information of the current context is shared with the assistant on the device.
The AOSP implementation meets this requirement by having controls in the notification shade. Android supports a variant theme with translucent system bars, which allows application developers to fill the area behind the status and navigation bar with their app content. To enable a consistent developer experience in this configuration, it is important the status bar icon style is maintained across different device implementations. Live wallpapers are animations, patterns, or similar images with limited input capabilities that display as a wallpaper, behind other applications.
Hardware is considered capable of reliably running live wallpapers if it can run all live wallpapers, with no limitations on functionality, at a reasonable frame rate with no adverse effects on other applications.
As an example, some live wallpapers may use an OpenGL 2. Live wallpaper will not run reliably on hardware that does not support multiple OpenGL contexts because the live wallpaper use of an OpenGL context may conflict with other applications that also use an OpenGL context.
Device implementations including the recents function navigation key as detailed in section 7. If device implementations including the recents function navigation key as detailed in section 7. Android includes support for Input Management and support for third-party input method editors.
If device implementations allow users to use third-party input methods on the device, they:. If device implementations declare the android.
Android includes support for interactivescreensavers , previously referred to as Dreams. Screen savers allow users to interact with applications when a device connected to a power source is idle or docked in a desk dock. Android Watch devices MAY implement screen savers, but other types of device implementations SHOULD include support for screen savers and provide a settings option for users toconfigure screen savers in response to the android.
If device implementations include a hardware sensor e. GPS that is capable of providing the location coordinates:.
Android includes support for the emoji characters defined in Unicode If device implementations have the capability to display multiple activities at the same time, they:. If device implementations support multi-window mode s and Picture-in-Picture multi-window mode, they:. Android includes features that allow security-aware applications to perform device administration functions at the system level, such as enforcing password policies or performing remote wipe, through the Android Device Administration API ].
If device implementations implement the full range of device administration policies defined in the Android SDK documentation, they:. Android provides an accessibility layer that helps users with disabilities to navigate their devices more easily. The TV app that is required for Android device implementations declaring the android. Android Television device implementations SHOULD support TV input app linking , which allows all inputs to provide activity links from the current activity to another activity i.
Android provides a Quick Settings UI component that allows quick access to frequently used or urgently needed actions. If device implementations include the UI framework that supports third-party apps that depend on MediaBrowser and MediaSession , they:.
Android includes support for companion device pairing to more effectively manage association with companion devices and provides the CompanionDeviceManager API for apps to access this feature. Device implementations MUST NOT install application packages from unknown sources, unless the app that requests the installation meets all the following requirements:. Device implementations MUST have an activity that handles the android. All of the codecs listed in the section below are provided as software implementations in the preferred Android implementation from the Android Open Source Project.
Please note that neither Google nor the Open Handset Alliance make any representation that these codecs are free from third-party patents. Those intending to use this source code in hardware or software products are advised that implementations of this code, including in open source software or shareware, may require patent licenses from the relevant patent holders.
See more details in 5. Audio Codecs Details. If device implementations declare support for the android. If device implementations support the decoding of AAC input buffers of multichannel streams i. Image Codecs Details. If device implementations advertise HDR profile support through Display. HdrCapabilities , they:. CodecCapabilities class, they:. If device implementations support any video encoder and make it available to third-party apps, they:. If device implementations include an embedded screen display with the diagonal length of at least 2.
If device implementations support any of the H. If device implementations support H. If device implementations report support of H. If device implementations report support of VP8 encoding for p or p resolution videos through the media APIs, they:. If the height that is reported by the Display. If the height as reported by the Display. If device impelementations declare android.
The android. If device implementations declare both android. AudioRecord API to record from this audio source, it captures a mix of all audio streams except for the following:. Android includes the support to allow apps to playback audio through the audio output peripheral as defined in section 7. Android provides an API for audio effects for device implementations. If device implementations declare the feature android. Audio latency is the time delay as an audio signal passes through a system.
Many classes of applications rely on short latencies, to achieve real-time sound effects. If device implementations meet the above requirements after any initial calibration when using the OpenSL ES PCM buffer queue API, for continuous output latency and cold output latency over at least one supported audio output device, they are:.
If device implementations include android. For exceptions please see the table footnotes in section 5. If device implementations support secure video output and are capable of supporting secure surfaces, they:. If device implementations declare support for Display. If device implementations report support for feature android. PackageManager class, they:.
If device implementations omit a 4 conductor 3. Android includes support for recording of unprocessed audio via the android. If device implementations intent to support unprocessed audio source and make it available to third-party apps, they:.
MUST not have any other signal processing e. Automatic Gain Control, High Pass Filter, or Echo cancellation in the path other than a level multiplier to bring the level to desired range. In other words:. All SPL measurements are made directly next to the microphone under test. For multiple microphone configurations, these requirements apply to each microphone. Android Debug Bridge adb. For example:. Dalvik Debug Monitor Service ddms.
Android includes support for developers to configure application development-related settings. If a device includes a particular hardware component that has a corresponding API for third-party developers:. If an API in the SDK interacts with a hardware component that is stated to be optional and the device implementation does not possess that component:.
A typical example of a scenario where these requirements apply is the telephony API: Even on non-phone devices, these APIs must be implemented as reasonable no-ops. Android includes facilities that automatically adjust application assets and UI layouts appropriately for the device to ensure that third-party applications run well on a variety of hardware configurations. The Android UI framework supports a variety of different logical screen layout sizes, and allows applications to query the current configuration's screen layout size via Configuration.
Specifically, device implementations MUST report the correct logical density-independent pixel dp screen dimensions as below:. While there is no restriction to the screen aspect ratio value of the physical screen display, the screen aspect ratio of the logical display that third-party apps are rendered within, as can be derived from the height and width values reported through the view.
The Android UI framework defines a set of standard logical densities to help application developers target application resources. Device implementations SHOULD define the standard Android framework density that is numerically closest to the physical density of the screen, unless that logical density pushes the reported screen size below the minimum supported.
If the standard Android framework density that is numerically closest to the physical density results in a screen size that is smaller than the smallest supported compatible screen size dp width , device implementations SHOULD report the next lowest standard Android framework density.
0コメント