i am making on application in marshmallow 6.0 but when i am trying to share a uri using Intent,i am not able to share image on facebook when the facebook permissions for storage is off through my app.
how to make facebook storage permissions to ON or how to prompt dialog for permissions to be granted while sharing link using our app.
Dangerous permissions cover areas where the app wants data or resources that involve the user's private information, or could potentially affect the user's stored data or the operation of other apps. For example, the ability to read the user's contacts is a dangerous permission. If an app declares that it needs a dangerous permission, the user has to explicitly grant the permission to the app.
Check this tutorial, easy mode by google:
https://github.com/googlesamples/easypermissions
for more information:
http://developer.android.com/intl/es/guide/topics/security/permissions.html#normal-dangerous
Related
requestPermissions(permissionsToRequest.toArray(new String[permissionsToRequest.size()]), 101);
In Android, after Marshmallow version, is there any way to turn on dangerous permissions like accessing device's fine location, camera or microphone automatically without user's consultation? If not, why is it so? What is the reason behind it?
I wish I would be able to closely monitor my iPad by using my smartphone while I am at office and it would be good if it were possible to do it without user's consultation. I also know that once an app is installed and if a user accepts for a dangerous permission at least once, then it would not prompt for it again.
By the way, why it is known as dangerous permission and not something like sensitive permission, as it intrudes user's privacy and makes it possible to access stored files on any given user's mobile device?
Dangerous permissions
Dangerous permissions cover areas where the app wants data or resources that involve the user's private information, or could potentially affect the user's stored data or the operation of other apps. For example, the ability to read the user's contacts is a dangerous permission. If an app declares that it needs a dangerous permission, the user has to explicitly grant the permission to the app. Until the user approves the permission, your app cannot provide functionality that depends on that permission.
To use a dangerous permission, your app must prompt the user to grant permission at runtime. For more details about how the user is prompted, see Request prompt for dangerous permission.
What is the best way to access the app usage database on Android, without using the API?
In particular, I would like to make a local copy of the database behind this API:
http://developer.android.com/reference/android/app/usage/UsageStats.html
There's no best way, other than the API. You may or may not receive the permission to access this data. On this page it says:
NOTE: This API requires the permission
android.permission.PACKAGE_USAGE_STATS, which is a system-level
permission and will not be granted to third-party apps. However,
declaring the permission implies intention to use the API and the user
of the device can grant permission through the Settings application.
It reads as though you might get the permission if you declare it and the user grants it... or you might not, as it will not be granted to third-party apps.
I have an Android app that uses the 'publish_actions' and 'user_photos' permissions to create photo albums on Facebook. I have already applied and been approved for 'publish_actions'. However, it will not let me apply for the 'user_photos' permission, because it says my app has not used this permission in the last thirty days.
My app does in fact use this permission. I have successfully published albums repeatedly from developer accounts and test user accounts. This only works if I use the 'user_photos' permission. If I try to create an album when I haven't requested 'user_photos', it doesn't work
Yet it still says I'm not using this permission. And I didn't have this problem with the 'publish_actions' permission; it was able to recognize that I was using it.
What do I need to do to make this permission available for applying? It almost seems like creating an album "requires" the permission, but does not "use" it.
I've heard some suggest that you need to be using the app owner's account, but again, this was not necessary for 'publish_actions'.
I solved this problem by changing the functionality of my app. Now my app reads in a user's albums, and appends photos to the album if it already exists. Doing so results in Facebook recognizing the use of the permission, which allows me to apply for it.
Overall, this still seems like a bug on Facebook's end.
You don't need the user_photos permission to publish photos, only publish_actions. You do need user_photos to be able to read (and get) the photos that a user has uploaded.
You, as an admin on the app, is allowed to grant any permissions you want to your app (since you'd need to be able to do that for development). Users who are not in an admin/dev/test role in your app will not be able to use any features that require additional permissions until your app is approved.
I am trying to control permission grant based on user choice. So if say user walks out in public and doesn't want to share his/her location with facebook app, he/she should revoke that pemission grant and system should send some fake data to facebook. Android 4.3 have this feature with permission manager, but it doesn't send fake data, rather block permission altogether rendering app not work at all.
Check out XPrivacyLua. Requires ROOT, though.
I'm working on an app which contains some scripting support. The scripts executed by this app might require all sorts of permissions in the future, but it's difficult to predict which ones.
Is there a way to request additional permissions at runtime (like iPhone apps sometimes do) instead of specifying them all in advance in AndroidManifest.xml?
According to the Android documentation:
The permissions required by an
application are declared statically in
that application, so they can be known
up-front at install time and will not
change after that.
The Android M introduces a new app permissions model which streamlines the process for users to install and upgrade apps. If an app running on the M supports the new permissions model, the user does not have to grant any permissions when they install or upgrade the app. Instead, the app requests permissions as it needs them, and the system shows a dialog to the user asking for the permission.
User Grants Permissions at Run-Time: When the app requests a permission, the system shows a dialog to the user, then calls the app's callback function to notify it whether the permission was granted. If a user grants a permission, the app is given all permissions in that permission's functional area that were declared in the app manifest.
For more information check this link.