How can Android 6 get the browser's history? - android

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.

Related

How to access chrome history from android api 25+?

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

Strange behaviour in Android M Permissions

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.

Get browser history over 6.0 Marshmallow

Is there way to get history on Android 6.0 Marshmallow?
This is intentionally not a supported use case. Using Android SDK's Browser provider right now it doesn't seems to provide history.
Look at this issue https://code.google.com/p/android/issues/detail?id=200685
API >= M ignores the permission argument and instead checks for com.android.chrome.permission.READ_WRITE_BOOKMARK_FOLDERS. This permission is limited to system apps and apps signed with Google's key.
https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser
Please refer to my answer as mention on below post
https://stackoverflow.com/a/45566687/7895502

Does Android 6.0 Changes affects previously published apps (Targeted API lower than 23)

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.

Android permission gven only from a minimum sdk version onward

Is it possible to declare a uses-permission for an app such that the permission is only given if the sdk version is at least a certain value?
I ask because I recently updated to KitKat (SDK Version 19) and to query for album art, one must now have the READ_EXTERNAL_STORAGE permission. But I don't want those updating the app to require a new permission just because those in 4.4 now require it...
Thanks
Just don't target KitKat, see http://developer.android.com/guide/topics/security/permissions.html
"Over time, new restrictions may be added to the platform such that, in order to use certain APIs, your app must request a permission that it previously did not need. Because existing apps assume access to those APIs is freely available, Android may apply the new permission request to the app's manifest to avoid breaking the app on the new platform version. Android makes the decision as to whether an app might need the permission based on the value provided for the targetSdkVersion attribute. If the value is lower than the version in which the permission was added, then Android adds the permission."

Categories

Resources