Hello! An important event will take place very soon - the release of Android O. Support for new versions of the operating system is the responsibility of any serious product. Each update of Android forces many developers to work seriously to preserve the functionality of existing functions and bring new ones thanks to the capabilities of new versions of Android.
In this article we will look at the main changes of Android O and evaluate their possible impact.
Working on Android O, Google developers first of all solved the problem of fast battery charge on Android devices, so the main changes are related to the optimization of background tasks and the use of application resources.
Changes in Android O can be divided into two categories:
Potentially "breaking" the current performance and requiring additional efforts to support;
Threat | Target> = O | Target <o | Effect |
---|---|---|---|
Background Location Limits | Affected | Affected | Restriction on geolocation query |
Background Execution Limits | Affected | Ok | Changing the list of available broadcasts in the manifest;
Changing the time of the services in the background. |
Notification Channels | Affected | Ok | Improvements for notification channels |
Windowmanager | Affected | Ok | Effect on overlapping windows |
Privacy (Build.Serial / net.dns / etc) | Affected | Affected | Changing the availability of user IDs |
AccountManager.
getAccounts () | Affected | Ok | A request for a list of accounts on the device returns null |
New opportunities | Application |
---|---|
Android Enterprise | Improving device control |
Autofill Framework | Autocomplete entry fields |
Notification Channels | UX enhancement |
Picture in Picture | UX enhancement |
Adaptive Icon | Vendor firmware consistency |
Accessibility button and fingerprint gestures | Improving UX (accessibility button in the navigation bar, trapping gestures on the fingerprint scanner) |
Webview Apis (eg Safebrowsing) | Improved Webview built-in capabilities |
Pinning shortcuts and Widgets | Software creation of shortcuts and widgets in the launcher |
In our opinion, these are the most significant (at least for Kaspersky Lab) changes in Android O. Consider each separately.
This is a limit on the number of location requests for applications in the background. So, starting with Android O and regardless of the TargetSDK installed, applications can receive only a few location updates per hour. However, these restrictions do not apply to applications for which at least one of the following parameters is valid:
Thus, for Foreground applications, the behavior will be the same as in previous versions of Android.
If the foreground service is absent, then the geolocation request will be changed:
The restriction on the background operation of the application is a key change of Android O, which will be noticeable to a large extent only when switching to targetSdk “O”. If targetSdk <= 25, then if the application is in the background and has been transferred by the system to the Cached state (when the system is free to kill the process at any time), and it does not have active components, the system will release all WakeLock ( that the application should not be able to sleep) of this application. It is important to note that if the application is not targetSDK <O, then in the settings you can set the behavior policy the same as if the application were with targetSDK O.
For applications with targetSdk, the “O” background execution limits consist of two categories:
startForeground()
, you must call startForeground()
within 5 seconds, otherwise the system may show ANR.Notification Channels is a tool for grouping notifications into subject groups that a user can manage directly. If the application is built with target> = O, then at least one of the notification channels must be supported. In case targetApi <O, then the work with notifications inside the product will remain the same.
Android O introduces a new type of windows (for targetSDK O) that can be displayed on top of other windows - TYPE_APPLICATION_OVERLAY. In this case, several old types of windows have become deprecated , and now when they are used, a RuntimeException is generated.
These types of windows can now be used only by system applications:
In Android O, there are some improvements designed to help the user manage access to their ids. These improvements include:
Starting with Android O, the GET_ACCOUNTS permission is not enough to access the list of accounts. Now there are two options for applications with targetSDK O:
AccountManager.newChooseAccountIntent()
.Google is actively developing Android for Work. In Android O, they provided more options for controlling the device. For example, for a working profile, you can get a separate lock with your own settings, find out information about available system updates.
With the advent of the Autofill Framework API, it has become possible to more conveniently fill user data into applications than when using Accessability. When you call the framework, you will need to match the packageName of the product for which the call to autocomplete occurred, and then provide the input data. To correctly identify the login and password fields, you need to create and maintain a database with resourceId controls or other service information that allows you to correctly identify UI elements for autofilling.
Android O allows you to run activity in Picture-In-Picture, which is a special type of multi-window mode. Google recommends using this mode exclusively for video display applications.
Starting with Android O, you can provide another version of Launcher Icon for the application, which the system can easily cut to a form that is used by the device manufacturer. Also, if there is such an icon, the system will be able to do some animation of application icons.
New feature Android O - software creating shortcuts and widgets in the launcher. The label is a separate icon that allows you to perform a task in the application for a given intent. Successful attachment of a widget or shortcut requires user consent in the system confirmation dialog.
The time when Android allowed you to do whatever you want is a thing of the past. Android expands the "legal" tools to create new functions, closes gaps for hacks and makes you work honestly. Android O breaks a part of existing applications, but tries to make the end users happier. Cheers thanks!
I wish everyone to write good apps, think about users and be happy owners of Android devices.
PS
The author of the article is Alexander Shindin ayushindin .
Sasha wrote an article and boldly fell ill, so he trusted me to put the article on Habr to me =)
We wish him a speedy recovery!
Source: https://habr.com/ru/post/334652/