This commodity will allocution you through how to adapt your app for Android P as a developer. It discusses how to analysis your app application the emulator, new appearance to attending into and compatibility/security issues to consider.
Android P is aloof about the bend — accepted about August this year — which is abundant account for accessory owners acquisitive to get some air-conditioned new appearance and UI changes.
For us developers, it agency it’s time to go to assignment and ensure our apps are ready. Here’s what you can alpha accomplishing now to accomplish abiding you’re acceptable to go.
First you charge to the grab Android P developer examination through the adversary to alpha testing your apps on the belvedere as anon as possible. You can get the SDK bales all-important to body with Android P as continued as you accept Android Studio 3.1 or higher. You’ll charge Android 3.2 to absolutely abutment all Android P appearance though, so aloof accomplish abiding you’re not blank that little alert in the basal appropriate to update. (Like we would anytime do that!)
To get started, actualize a new Android adversary application the AVD Manager, and accomplish abiding to baddest and download Android P as the arrangement image.
Once that’s done, you can busybody about the new OS to analysis out the assorted changes for yourself and activate testing your apps as you usually would.
When Android P is available, devs will be able to booty advantage of these new appearance and ambition the new adaptation in their releases.
Most of us should be accustomed with this action by now. Aloof amend the ambition adaptation to P and you’re acceptable to go. For your app to assignment back targetSdkVersion is set to P, a few requirements that charge be met:
For the majority of developers, alone the aboriginal affair is acceptable to crave your attention. You can get added detail here.
These changes will administer to all Android apps, whether they ambition Android P or not, and about circumduct about security, with accurate absorption paid to accomplishments apps.
Background apps will no best be able to admission the microphone or camera. Sensors application the connected advertisement approach (gyroscopes for instance) will not accept events, nor will those application on-change or one-shot advertisement modes.
Cryptographic changes accept been fabricated to enhance security.Bouncy Castle has depreciated, replaced with Conscrypt implementations. Added cryptographic change accept been made, but afresh this is article a lot of app developers won’t charge to anticipate about. Android Secure Encrypted files (ASECs) are additionally no best supported.
Some affinity changes may appulse those application absorption or added non-SDK methods. These still assignment in Developer Examination 1, but a acknowledgment bulletin will be displayed to accompany them to your attention. the UTF-8 decoder is stricter in Android P with a few changes.
The new circling affection demoed by Joe Hindy in his accomplished Android P overview is additionally article to accede – admitting it acceptable won’t accept abundant of an appulse for best developers. If you accept set an acclimatization alternative in the apparent or programmatically, again this will still assignment as normal.
There are absolutely a few added considerations. Read the official affidavit for added on these behavior changes.
The best way to acquisition out if you charge to accomplish changes admitting is artlessly to analysis with the emulator. As Google puts it: “update your targetSdkVersion to P, verify the app continues to action as expected, and again activate application new APIs.” If things stop working, analysis the affidavit to acquisition out why.
Android P introduces a abundance of new appearance that developers will be able to comedy about with to enhance their apps’ functionality. These include:
Wi-Fi RTT agency “Wi-Fi Round-Trip Time.” It allows Android to assignment out how far it is from a Wi-Fi hotspot. That’s will be acclimated in affiliation with GPS to accompany calm area tracking with an accurateness of about 1-2 meters.
If you accept a aeronautics app, Pokemon Go competitor, or own a arcade mall, this is article to attending into. You’ll charge to accept the ACCESS_FINE_LOCATION permission in your apparent to use it. The app doesn’t charge to affix to the Wi-Fi admission point to use this feature, as the permission is advised “normal” and accepted irenic with no charge for run-time permission.
This is aloof cleft support. Added and added users accepting on the #notchlife bandwagon, so it’s added important app developers abutment the look. This is article you can do with acute UI choices (like not afraid acute elements appropriate in the top centermost of the screen) but through Android P, you’ll now be able to use a DisplayCutout chic to acknowledgment the absolute “non-functional” areas of the affectation via the getDisplayCutout() method.
Android P will additionally acquiesce users to try assuming the cutout. that way, you can absolutely see contiguous what your app would attending like on a Huawei P20 or Essential Phone — or ambush your accompany into cerebration you accept the latest accouterments trend!
Android P brings added functionality to notifications, too:
Android P additionally makes it easier for you to administer the Notification Channels alien in Oreo. You can concern the accepted settings for a approach accumulation application getNotificationChannelGroup() and analysis whether the accumulation is blocked with isBlocked().
There are added new appearance for devs too. The AnimatedImageDrawable class will appearance GIF and WebP images after an alien library for example. ImageDecoder is actuality to alter BitmapFactory. At a glance, it doesn’t attending to cut bottomward on the boilerplate all that abundant to aloof affectation an image, but it does accept accessible methods like setResize() and setCrop(). And it allows you to add some air-conditioned furnishings such as angled corners and amphitheater masks with setPostProcessor(). This can additionally be acclimated in affiliation with AnimatedImageDrawable to add angled edges to GIFs. So that’s cool.
For those demography advantage of onboard apparatus learning, the Neural Networks API alien in Android 8.1 has been upgraded with nine new ops.
There are affluence added little tweaks and upgrades too, so get it the abounding account of appearance from horse’s aperture here.
There’s absolutely some assignment to do, abnormally if you accept an app that uses accomplishments casework or sends a lot of data. Those with simple amateur or utilities apparently won’t accept too abundant appointment to do, admitting you ability appetite to see how they attending with the cleft cutout.
There are a few nice aliment befuddled in there for acceptable admeasurement too, which will hopefully accomplish your activity easier and acquiesce you to accommodate your loyal users with a bigger experience.
See Also: hack hikeTry out Android P appropriate now!
Ensuring compatibility
Behavior and security changes
New features
Closing Thoughts
- If your app uses beginning services, it charge appeal the FOREGROUND_SERVICE permission first. This is a accustomed (passive) permission.
- Bouncy Castle ciphers are no best used. getInstance() calls requesting the Bouncy Castle provider will accomplish NoSuchAlgorithmException. Instead, appeal the absence implementation.
- Apps charge use the new getSerial() method rather than Build.serial and appeal the READ_PHONE_STATE permission
- Apps cannot allotment a distinct WebView abstracts agenda amid assorted processes. If your app has added than one action application WebView, CookieManager, or added APIs from webkit, it will crash.
- Apps may no best admission the abstracts directories of added apps by path
- Display images in your bulletin notifications via setData().
- Use the new person class to added calmly get advice about the contacts complex in a conversation
- Identify whether a chat comes from a accumulation chat by application setGroupConversation() to analyze it as such
- Set semantic accomplishments for intents with the setSemanticAction() method (for “read,” “delete,” “reply”)
These changes will administer to all Android apps, whether or not they are targeting Android P
The AnimatedImageDrawable chic lets you appearance GIF and WebP images after an alien library
Comments
Post a Comment