What does Advanceable Added in API level 16 mean? And how to use those two methods in Advanceable Api?I saw this interface in Launcher source code. I am not clear about the specification in android docs.Thanks.
It means that only devices with api level 16 or above knows/can use that method/class. And will fail to run if you put the code under a device with api level 15 or lower.
Related
Previously, I implemented light and dark navigation bar, however now tags as android:navigationBarDividerColor and android:windowLightNavigationBar require API level 28 when they previously required API level 27.
It seems API level 28 does not even exist as next API level is called P.
Is there any solution to this problem? Thanks in advance.
UPDATE: it seems to work now on API 27 with latest support libraries
When the "next upcoming API" is still under development, its "name" is a letter (P in your case).
Once the final version of the API is available, the "name" is changed form a letter to a number (P to 28).
Final version of Android API 28 (former Android P) is available since early June 2018. Just use the SDK manager and you'll be able to download it ;-)
Note:
Sources for "Android SDK Platform xx" (28 in your case)" is not available right away. (not available ATTOW)It can takes a few weeks before they are available for download from the SDK manager.
Today I've updated compileSdkVersion, targetSdkVersion and buildToolsVersionfrom 27 to 28. Now I'm facing the same issue as #Teďourek described.
While it was working for me on 27, since the upgrade I now get lint errors:
Error: android:navigationBarDividerColor requires API level 28 (current min is 19)
Error: windowLightNavigationBar requires API level 28 (current min is 19)
This is strange because according to the docs for both attributes it says:
"added in API Level 27"
My temporary fix is to move the two style attributes to v28/styles.xml instead of v27/styles.xml
Since I would like to use lightNavBar + color also on Android 8.1.0 as previously, I would be happy if anyone knows a fix!
With compileSdkVersion and targetSdkVersion set to 29 it seems to be correct.
The XML properties tell me it was added in API level 27.
Only the Java Window properties are added in API level 28.
I am trying to secure WebView from cleartext traffic. As mentioned in the documentation. I have to set android:usesCleartextTraffic as false to achieve this. But this works on API level 23 and above. My minimum sdk is 22. How can I make sure app doesn't crash or create any problem on device running below API level 23 ? Or how can I programmatically set that attribute value in the application tag in Manifest.xml ?
As suggested in an article # Android Developers Blogspot:
You don’t have to set minSdkVersion or targetSdkVersion of your app to 23 (Android Marshmallow) to use android:usesCleartextTraffic. On older platforms, this attribute is simply ignored and thus has no effect.
Hope this solves your query.
When you use usesCleartextTraffic in manifest, you get the following warning :
Attribute usesCleartextTraffic is only used in API level 23 and higher
(current min is 19).
The default value of usesCleartextTraffic is as the following :
for apps that target API level 27 or lower is "true".
for apps that target API level 28 or higher default to "false".
This attribute was added in API level 23.
This flag is ignored on Android 7.0 (API level 24) and above if an Android Network Security Config is present.
https://developer.android.com/guide/topics/manifest/application-element
https://android-developers.googleblog.com/2016/04/protecting-against-unintentional.html
What is the difference between
android.util.ArraySet
android.support.v4.util.ArraySet
All methods seem to be identical.
As the page indicates, android.util.ArraySet was added in API level 23. android.support.v4.util.ArraySet is a copy in the backwards-compatibility support library, which allows you to use the class on older devices as far back as API level 4 (increased to level 14 in recent releases).
I am using android.support.v8.renderscript API, and I want to use the static function ‘createX’ of the class ‘Type’.
It seems that ‘createX’ does not exist in ‘Type’! And when I use it, I get this error:
Cannot resolve method 'createX(android.support.v8.renderscript.RenderScript, android.support.v8.renderscript.Element, int)'
But when I change the API to android.renderscript, it seems ok, and no error occurs.
I have these lines in my build.gradle:
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
Does anyone know how to solve this problem? I am supposed to use android.support.v8.renderscript, not android.renderscript.
Type.createX() was only added in API 21. As you are using renderscriptTargetApi 19, you only get access to API 19 Renderscript methods - change it to target the latest (at this time, 22) to use methods introduced in later API levels. Note that all methods are supported back to API 8.
in Android :
I want to use the method : getLoaderManager.initLoader() with API level 10 .
I know that this method requires API Level 11 or higher and i tried to use Android Support package but this package doesn't have this method .
what can i do ??
It sure looks to me like the Android Support Package has it. See the docs for android.support.v4.app.LoaderManager.initLoader().
Update:
For the equivalent of getLoaderManager, see getSupportLoaderManager.
You can increase the minimum SDK to level 15 and it will work fine.