Blog

Android P Beta 4 from Developer’s perspective

Android P Beta 4 is currently accessible for Pixel gadgets and top gadget. Introduce the beta on any supported gadget for testing and development or just to attempt Android P.

Android P introduces great new features and capabilities for users and developers. Let’s take a look at what’s in for developers.

 

Animation

Android P has the new AnimatedImageDrawable class for drawing and showcasing GIF and WebP animated images. Its working is similar to AnimatedVectorDrawable in that RenderThread drives the animations of AnimatedImageDrawable.

An ‘AnimatedImageDrawable’ can be decoded with the new ImageDecoder.

 

Indoor Positioning with Wi-Fi RTT

Android P has added a platform for IEEE 802.11mc Wi-Fi protocol known by the name of Wi-Fi Round-Trip-Time (RTT). With this newly added feature you can take advantage of indoor positioning in your apps.

On Android P devices with hardware support, your apps can use the new RTT APIs to measure the distance to nearby RTT-capable Wi-Fi Access Points (APs).

Within a distance of  3 or more APs, multilateration algorithm can be used to estimate the device position. The result is typically accurate within 1 to 2 meters.

In-building navigation, fine-grained location-based services such as disambiguated voice control can be possible with this accuracy.  

 

Display cutout support

Android P provides support for the edge-to-edge screens with display cutout for camera and speaker. With the new

‘DisplayCutout’ class you can find out the location and shape of the non-functional areas where content shouldn’t be displayed. The existence and the placement can be found with ‘getDisplayCutout()’ method.

A new window layout attribute, ‘layoutInDisplayCutoutMode’, allows your app to lay out its content around a device’s cutouts. You can set this attribute to one of the following values:

LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT

LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES

LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER

 

Multi-camera support and camera updates

Now different streams can be accessed from two or more physical cameras on devices running Android P.

Devices with dual-front or dual-back cameras, you can create interesting features like seamless zoom, bokeh, and stereo vision. The API lets you call a logical or fused camera stream that automatically switches between two or more cameras.

Android P also enables support for external USB/UVC cameras on supported devices.

Session parameters are also introduced as a new feature that helps to reduce delays during initial capture.

In Android P the multi-camera API supports monochrome cameras for devices with FULL or LIMITED capability. Android P also enables support for external USB/UVC cameras on supported devices.

 

ImageDecoder for drawables and bitmaps

ImageDecoder is added to Android Pto provide an innovative approach for decoding images. ImageDecoder can be used to decode an image rather than the BitmapFactory and BitmapFactory.Options APIs.

ImageDecoder lets you create a Drawable or a Bitmap from a byte buffer, a file, or a URI.

ImageDecoder has many other ways that allow you to further enhance the image. For example, you can use the ‘setPostProcessor()’ method to modify the appearance of the image, such as applying a circle mask or rounding corners

 

Security enhancements

A number of new security features are introduced in Android P. A unified fingerprint authentication dialog and high-assurance user confirmation of sensitive transactions.

 

On-device system tracing

In Android P, you can now record system traces from your device. System tracing allows you to capture timing data for each process that’s running on an Android device and to view the data in an HTML report. It is useful for identifying what each thread is doing and for viewing globally important device states.

 

Notifications

Android P introduces several enhancements to notifications, all of which are available to developers targeting Android P and above.

Android P enhances the messaging experience with following features:

Simplified support for conversation participants. Many other APIs, such asaddMessage(), now hold the Person class instead of a CharSequence. The Person class also supports the Builder design pattern.

Android P now displays images in Messaging Notifications on phones.

The app can retrieve the ‘EXTRA_REMOTE_INPUT_DRAFT’ sent by the system when a user inadvertently closes a messaging notification and save replies as drafts.

‘setGroupConversation()‘ can be used to purposefully identify a conversation as a group or non-group conversation.

Use ‘RemoteInput.setChoices()’ to provide an array of smart reply to the user

 

Write a comment