Changes for API 28

Changes for API 28
January 21, 2019 No Comments Android Development,Development,Research And News Pushpendra Kumar



What are the changes made by Android in API 28+

That is the big question in front of every developer to know about the changes, which are made in API 28+ (Android 9). So here I will introduce you with a description of a few important technical things, which you have to keep in mind while you are developing for API 28.

API 28 (Android 9) include different behavior changes which help to improve your application performance and security. But these changes take effect only if your app targets API level 28 or higher.

Foreground services

Apps that target Android 9 or higher and use foreground services must request the FOREGROUND_SERVICE permission. This is normal permission, so the system automatically grants it to the requesting app.



If an app that targets Android 9 or higher attempts to create a foreground service without requesting FOREGROUND_SERVICE, the system throws a SecurityException.

Privacy Changes

There are two different privacy enhancement one is build serial number and another is DNS Privacy

Build serial number deprecation

In Android 9, Build.SERIAL is always set to “UNKNOWN” to protect users’ privacy.

If your app needs to access a device’s hardware serial number, you should instead request the READ_PHONE_STATE permission, then call getSerial().

DNS privacy

Apps targeting Android 9 should honor the private DNS APIs. In particular, apps should ensure that, if the system resolver is doing DNS-over-TLS, any built-in DNS client either uses encrypted DNS to the same hostname as the system, or is disabled in favor of the system resolver.

Framework security changes

These framework security changes are applicable on only API 28 or higher than API 28.

  •  If your app targets Android 9 or higher, the isCleartextTrafficPermitted() method returns false by default.
  • Apps cannot share a single WebView data directory among multiple processes. Typically, such data directories store cookies, HTTP caches, and other persistent and temporary storage related to web browsing.
  • Apps that target Android 9 or higher cannot share data with other apps using world-accessible Unix permissions.

 Apache HTTP client deprecation

To continue using the Apache HTTP client, apps that target Android 9 and above can add the following to their AndroidManifest.xml This line you need to use inside the Application

And there is much more changes. Officially you can get all those changes on Google Developer Official website

Here Few more tutorial which may help to utilise your skills.

  1. Typeface in kotlin
  2. How to check the instanceof anything in android Kotlin
  3. Custom adapter for RecyclerView in Android with Kotlin
  4. And much more



Tags
About The Author
Pushpendra Kumar I am passionate about mobile application development and professional developer at Colour Moon Technologies Pvt Ltd (www.thecolourmoon.com). This website I have made so that I can meet with new challenges and can share here.

Leave a reply

Your email address will not be published. Required fields are marked *