since the normal permission was removed in kitkat, I find it really hard to find any information.
I want to access the default installed chrome browser's history in android oreo or around that version
Looks like it is not possible anymore since Android 6 Marshmallow.
The release note tells us :
Browser Bookmark Changes
This release removes support for global bookmarks. The android.provider.Browser.getAllBookmarks() and android.provider.Browser.saveBookmark() methods are now removed. Likewise, the READ_HISTORY_BOOKMARKS and WRITE_HISTORY_BOOKMARKS permissions are removed. If your app targets Android 6.0 (API level 23) or higher, don't access bookmarks from the global provider or use the bookmark permissions. Instead, your app should store bookmarks data internally.
It was once reported as a bug but as comment 2 says, it is deprecated
Related
According to the 6 feature released by Android, READ_HISTORY_BOOKMARKS permissions have been removed in more than 6 systems. So how can we get the browser's history?
you should store them now internaly
see android official answer on the matter:
This release removes support for global bookmarks. The
android.provider.Browser.getAllBookmarks() and
android.provider.Browser.saveBookmark() methods are now removed.
Likewise, the READ_HISTORY_BOOKMARKS and WRITE_HISTORY_BOOKMARKS
permissions are removed. If your app targets Android 6.0 (API level
23) or higher, don't access bookmarks from the global provider or use
the bookmark permissions. Instead, your app should store bookmarks
data internally.
I am wondering if that if I only test this application in this version of API, will it work still the same as API versions above? If it doesn't, what's a good way to develop an application? Create it 1 by 1 for each API?
I heard from my friend that he developed his app in KitKat but when he tested it in Marshmallow, some features are not working right.
My friend also met a problem similar to your friend's. His app runs well in kitkat but when he use Lollipop, the camera cannot work. There is nothing absolute, you can only test your app on as many devices as possible.
For some deprecated methods, you should keep an eye on them to make sure they can still work on higher sdk levels.
Something even more annoying is that some manufactures change the API so that they can customize the OS deeper such as Xiaomi MIUI.
There is no such guarantee. You should pay attention every time a new major android version is released as it might affect your app, even if you're targetting a lower api level.
For example, Android O will limit background execution, even if you don't target api level 26. See: https://developer.android.com/preview/behavior-changes.html#atap
Things are changing since every android update and here are a few of the many things which one should keep in mind while developing an application:
Runtime permissions are a major change in Marshmallow and onwards. Gone are the days when developers could add whatsoever permissions. Runtime permissions prompts the user to grant a permission to run a specific feature in the application and the user has an option of denying it. In case you haven't checked if your app has been granted the required permissions before conducting an operation you will get a security exception.
Permission groups has been added. Each group has a set of permissions and one should check in which group your required permission falls before prompting for it.
Location services API has also undergone some changes. As per the old API the user would be taken to the settings page in order to turn on the location services. This has changed and now the user can be prompted to turn on the location services using the new API. Check documentation for more details.
Android O limits the number of background tasks which can be executed. So as a developer you have to be wise about which task is being executed in which thread.
App signing process has also changed significantly especially for application supporting marshmallow and above.
These are just a few of the things which one may keep in mind while developing an application. Also look out for deprecated api's.
So I have this app that I made before the Android M came out, the app has permissions such as Camera(using custom camera within the app) Write & Read from external storage and System Alert permission I installed the app to my phone which has android 6.0 and the app was able to run normally and without any restrictions. I was able to use the camera, save files into sdcard & show a custom view using the WindowManager API.
please take a note that the target SDK for the app is android lollipop.
my question: is this even possible? the OS let apps that has target SDK smaller than M to run perfectly without asking for permissions? and if this is actually the default behaviour that android developers implement?
P.S: the identified question is not really applicable for my question. and i don't see any similarity between them at all.
Yes, it is possible. But that can give you a big problem. If the user deactivates some permission your app simple crushes because the permission is no longer available. The OS ask the user "This app was developed for a previous android version. disabling this permission can cause unexpected closing of the app" (ore some thing similar). In conclusion this is the normal behaviour because the android version that you are using to compile your app is before permissions needed to be confirmed by the user.
https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en
this link explains all you need to now about your question .
Yes, if your app has targetSdkVersion below 23, it will work on M and above without asking any permissions (they will be asked during installation).
But if user will revoke any permission himself, app will crash. It was made by Google to get backwards compatibility with old applications that does not support new Permissions API.
You can read more about it here.
Here is quote from that page:
If the device is running Android 5.1 or lower, or your app's target
SDK is 22 or lower: If you list a dangerous permission in your
manifest, the user has to grant the permission when they install the
app; if they do not grant the permission, the system does not install
the app at all.
According to Android M Changes page, there is a new platform changes for Android 6.0. and they saying that
If you have previously published an app for Android, be aware that these changes in the platform affect your app.
So if my app is previously released before Android M release, and my app targeting API 21
1- Does this new changes will affect it?
2-Does i have to update my code to follow this new changes to be compatible with Android Mand raise the API Level to be 23?
** take in consideration in Android developer they says
If the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect.
Does this forward compatibility is applied to the Android M changes or not?
** i know this is a foolish version and i am daft man but please i need a help.
Does this new changes will affect it?
Some will. For example, while all of your permissions that you request in the manifest will be granted at install time (as they used to), the user can go in and deny them to your app in Settings. However, usually, all this will do is block access to data from your app, in ways that you should be handling already. For example, you might ask for READ_CONTACTS and query ContactsContract, but you should be handling the case where the user has no contacts. On Android 6.0, you might get no contacts in response to your query because the user denied your app access to contacts.
Does i have to update my code to follow this new changes to be compatible with Android Mand raise the API Level to be 23?
Generally speaking, no. Older Android apps usually work fine on Android 6.0.
However, eventually, there will be something that you want to have that requires targetSdkVersion of 23 or higher, in which case you will need to take other changes into account, such as the runtime permissions. And, you will need to test your app on Android 6.0, to see if Android 6.0's changes trigger bugs in your code.
I'm wanting to clarify on the key changes of marsh mallow 6.0.
Are there any changes that we need to be aware of as developers, as opposed to user only or OS features that do not affect development.
If so how do we manage these changes? example do we need to disable a feature, will it cause application crashes or it will open the setting page and asking for enabling the feature for that application.
I was so confused about how the recent changes affect developers, I was looking for some clarity.
As far as I can see there's no need to enable or disable features, the developer needs to be mindful of what target sdk they are developing in when creating or updating apps.
The biggest change to developers in the latest upgrade is Runtime Permissions.
Taken from:
Everything every Android Developer must know about new Android's Runtime Permission
Although Android is being keep developed but the latest update to Android M is totally different since there is some major change that would change everything like new Runtime Permission. Surprisingly it is not much talked about in Android Developer community even though it is extremely important and may cause some big trouble in the near future.
.../...
You might already feel like there is some cold wind blowing through your arms ... If you are an Android Developer, you will suddenly know that programming logic is totally changed. You cannot just call a function to do the job like previous but you have to check for the permission for every single feature or your application will just simply crash !
Correct. I would not spoil you that it is easy. Although it is a great thing for user but it is truly nightmare for us developer. We have to take coding to the next level or it will surely have a problem in both short-term and long-term.
Anyway this new Runtime Permission will work like described only when we set the application's targetSdkVersion to 23 which mean it is declared that application has already been tested on API Level 23. And this feature will work only on Android 6.0 Marshmallow. The same app will run with same old behavior on pre-Marshmallow device.
This means user permissions are not being requested at install time, but at runtime. This is done using a permission request, and can be saved by the user for one run of the app, or as a default 'always'. This permission can always be revoked in the device settings.
As the api is backward compatible, any devices running with apps of targer sdk < 23 will still be ok.
However these same apps will not run on android devices >= 6.0 with a target sdk of 23 if the runtime permissions are not implemented and the user failing to give permission needs to be managed to stop apps from crashing.
The only manisfest permissions that will require runtime permission requests are those that are deemed as a dangerous permission level, so accessing personal information, camera, etc.
Permissions are grouped and once a permission is given for one item of a group, permission is then granted for the remaining permissions of the group.
For more detail Sytem - Permissions.