google-codenex solutions

Google Unveils Android P Developer Preview

Google has just released a developer preview for Android’s next version, currently known only as “Android P”. The preview allows developers to get a head start on making their apps compatible with the new Android release before it eventually launches in Q3.

The first Android P developer preview is available for download now at developer.android.com. The preview includes an updated SDK with system images for the Pixel, Pixel XL, Pixel 2, Pixel 2 XL, and the official Android Emulator. Unlike last year, there is no emulator for testing Android Wear on Android P.

The feature that will probably garner the most discussion is built-in support for a notch cutting into the display at the top of the screen. (Google’s term for it is “display cutout support.”) Those notches were unavoidable on new Android phones at Mobile World Congress last month, so that support is going to be important at least until companies stop blithely copying Apple’s iPhone X. In the meantime, developers will be able to test how their full-screen apps will work with notches with the new tools Google is releasing today.

Features of Android P in Developer Preview

Improved Messaging Notifications

Notifications have a more minimal look in Android P, with a design that matches the rest of the update’s aesthetic. The notification cards have newly rounded corners and a simple line separating each individual notification. The notifications themselves have also got new layouts and features, like showing contact images and profile pictures into the notification.

Smart replies are also natively integrated into the notifications on messaging apps. If you’ve used Google’s Reply app, or the smart replies feature for Gmail, the AI recommendations for replies should be familiar.

Indoor Positioning With Wi-Fi RTT

Accurate indoor positioning has been a long-standing challenge that opens new opportunities for location-based services. Android P adds platform support for the IEEE 802.11mc WiFi protocol, also known as WiFi Round-Trip-Time (RTT), to let you take advantage of indoor positioning in your apps.

On Android P devices with hardware support, location permission, and location enabled, your apps can use RTT APIs to measure the distance to nearby WiFi Access Points (APs). The device doesn’t need to connect to the APs to use RTT, and to maintain privacy, only the phone is able to determine the distance, not the APs.

Knowing the distance to 3 or more APs, you can calculate the device position with an accuracy of 1 to 2 meters. With this accuracy, you can build new experiences like in-building navigation, fine-grained location-based services such as disambiguated voice control (e.g.,Turn on this light’), and location-based information (e.g., ‘Are there special offers for this product?’).

Display Cutout Support

Now apps can take full advantage of the latest device screens with full-screen content. We’ve added a display cutout into the platform, along with APIs that you can use to manage how your content is displayed.

Cutout support works seamlessly for apps, with the system managing the status bar height to separate your content from the cutout. If you have critical, immersive content, you can also use new APIs to check the cutout shape and request a full-screen layout around it. You can check whether the current device has a cutout by calling getDisplayCutout() and then determine the location and shape of the cutout area using DisplayCutout. A new window layout attribute, layoutInDisplayCutoutMode, lets you tell the system how and when to lay out your content relative to the cutout area. Details are here.

To make it easier to build and test cutout support in your app, we’ve added a Developer Option that simulates a cutout on any device. We recommend testing your existing apps with display cutout enabled to ensure that your content displays properly.

Prevent Background Apps From Accessing The Camera And Recording Via Microphone

New rule sets in Android P will now prevent idling background apps from accessing the camera and recording you via microphone. This move is aimed at preventing the increasing number of malicious malware apps and trojans from taking control of your smartphone when the screen is turned off.

The new API rules change target apps (user IDs), the identifiers Android assigns each application at install time, they’re unique to each app, and they don’t change as long as an app remains installed on your phone or tablet; it’ll retain the same app ID.

In Android P, when the camera service detects any app UID is idle, that is, Doze mode, and background running apps limited access to access to CPU and network-intensive services, it will now generate an error and close access to the camera and any subsequent camera requests from the inactive UID will generate errors.

In the same way, Android P will also impose limitations on idle background apps from accessing the microphone. Technically, any app that you might have granted microphone access could be running in the background and recording anything you say, though Android Oreo limited that, it was still a possibility. Google is working on fixing it.

In Android P, Google is aiming at restricting microphone access when an App’s UID enters an idle state. Instead of writing data from the microphone to a file, it’ll report empty data. Once the app becomes active again, it’ll start recording real data. This again is a privacy and security measure from making apps record everything. Both the camera and microphone limited access shows how privacy is a major concern for Google in tackling the malware and malicious attacks.

New Transition Animations

There’s notch support, a new screenshot button, and even a way to edit screenshots after you’ve taken them, just to name a few. But one feature that’s easy to overlook is the new transition animations, which have been completely revamped.

Up through Oreo, transition animations were pretty fast and uninteresting — they mostly just moved a tiny bit, then did a crossfade effect to finish the transition between one screen and the next. But with Android P, new menus now slide up from the bottom of the screen and even have a little bounce effect as they’re moving.

When you go back, the animation plays in reverse (from top to bottom). These animations are present in menus everywhere, virtually any time you move from one activity to another within the same app. Of course, some third-party apps will employ their own animations, but the new P style is present in Google apps such as Chrome.

This doesn’t apply to home screen animations, which are still the same in the first developer preview build of Android P. Nonetheless, the new animations have a Material Design feel to them, so they’re a welcome addition!

For more about new features of Android P click here.