Ask for permission on demand [duplicate] - android

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is there any way to ask permission programmatically?
as my app requires the permission<uses-permission android:name="android.permission.CALL_PHONE" />
most of my users aren't happy cause on installation there's a text "paid services" (or sth) because in my app I have to make calls.
Afaik there IS a solution to NOT write permissions in the manifest, but ask for them as they are used.
How can I achieve this?

You cannot change permissions of existing app, but you may create two different apps, one with CALL_PHONE permission, and another one without it. And let the people decide which one they want to install.

Although I'm one of the developers who would like to see some hybrid permission system in place, there is no solution as of today, at least according to the docs.
Android has no mechanism for granting permissions dynamically (at run-time) because it complicates the user experience to the detriment of security.
Source

Related

What permissions are considered special in the Play Store?

I have added the following permissions onto my app:
full network access
view network connections
When installing the app the Play Store says: "APP_NAME does not require any special permissions". I assume that the two permissions are not considered special.
However they are listed in the permissions section of the app webpage on the store website. They fall under the "other" category.
How may we know which permissions are not considered special if we want to avoid adding them to the app? Is there a list anywhere?
You are looking for the Review App Permissions
Google Play prioritizes the permissions that are most important for
you to make an informed decision, displaying them front and center.
A concise idea about it has been described on this blog about the Permission Groups change.
Welcome to StackOverflow, do try to post (almost only) code related questions here. Refer Help to read more on why code related Qs.

Why are <uses-permission> needed in android? what is their intention?

Why exactly uses-permission
Ex :
<uses-permission>android:name="android.permission.ACCESS_NETWORK_STATE"/>
is needed to access various modules of Android. How is it that just adding one single line that too by the same programmer who is coding it, is actually providing security? I am new to Android programming and this is looking funny. Kindly explain what is the exact use of quoting the <uses-permission>
Google made a whole page to describe the concept. Go through it and you will know the reason.
http://developer.android.com/guide/topics/security/permissions.html
EDIT: In addition to above information. These required permissions are shown to the user at the time of installing the application. They are even visible at the google play store for each app. While most users don't see reqd permissions before installing, some might check them out and if its interfering with their privacy more than required they may not install it or even give bad reviews on play store. These are mentioned in AndroidManifest so Google doesn't have to go through all the scenarios to check what all services the application might request in future.
Whatever permissions you have added in <uses-permission> are actually used later at installation time of your application. User will be asked that this applications require following permissions: Access network states. And if user accepts, the application can be installed. Else application won't be installed.
Refer to this for ore clarification.

How to overcome this error android.permission.MODIFY_PHONE_STATE.? [duplicate]

This question already has answers here:
How to grant MODIFY_PHONE_STATE permission for apps ran on Gingerbread
(5 answers)
Closed 10 years ago.
How to resolve this issue android.permission.MODIFY_PHONE_STATE. when i'm trying to answer my call this error should occurred.
The problem you're having was introduced in Android 2.3 (Gingerbread). Any code you have that requires MODIFY_PHONE_STATE will work all the way up to (and including) Android 2.2, but will break for Android 2.3+.
A change was checked in by David Brown that limits the use of the MODIFY_PHONE_STATE permission to system apps. System apps are either
Pre-installed into a system folder on the ROM
Compiled by a manufacturer using their security certificate
There was an issue opened for this, but Google killed it. They did this on purpose, not by accident, and clearly have no intention of reversing it.
I suspect you're trying to use a hidden API like ITelephony. I am - and I got burned by this. The Android team's justification is that it was hidden and you shouldn't have been using it anyways. My personal belief is that there was no security risk (it needed a permission) so just leave it in place until they finish building a proper public Telephony API.
You are not having this permission in the app manifest
Add permission in the manifest android.permission.MODIFY_PHONE_STATE
If the problem still remains please follow the stackoverflow internal link.

What is the equivalent of Android permissions in iOS development? [duplicate]

This question already has answers here:
Android like permissions in iOS
(3 answers)
Closed 9 years ago.
I am not sure how to search for this so even a bunch of keywords would be enough or +1 if someone can point me to the relevant documentation.
Android has approx. 122 permissions described here. What is the equivalent in iOS? Do developers declare permissions or can they access everything? If everything, where can I find what this "everything" entails?
Although there are key differences in the way iOS and Android access the system, what Apple have done is to let you use some system resources (such as contacts or photos for example) and also register your app via some keys in a property list for using features such as background execution (for example a voip application that would like to listen for incoming calls). You can find all these options (keys) here.
There is no manifest-like permission concept in iOS. You can access every public API, as long as it is not against the developer agreement, and if you do something wrong, your application will be rejected by Apple.
There is no concept of "permissions" in iOS, there are certain things you are allowed to do and certain things you are not. You need not ask the user for access to these permissions.
I don't know of a specific list of things you are allowed to do, but the Review Guidelines should give you a good idea.
There is no concept of permissions for iOS (iOS 5; may happen in iOS 6 but do not count on it). You can only access official API as approved by Apple. Use of any unofficial API is not permitted and as such will in most cases leads to your app being rejected for distribution in the AppStore.
The closest you will find to permissions in notifications you see when using Location. See more #: http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/TechnologyUsage/TechnologyUsage.html#//apple_ref/doc/uid/TP40006556-CH18-SW10
Regards,
Bo
There is no such thing in iOS unfortunately. You might interested in reading this article about the difference between iOS and Android on this particular point.

get Android permission dynamically

I'm wondering if it's possible to get Android permission dynamically without using AndroidManifest just with some codes, because I've some OSGi bundles running on Android and without Android permission they are restricted in functionality.
Thanks for your answers, yes it complicates the user experience and it's also dangerous for the user if that mechanism is provided
No this is not possible.
You can't alter the contents of an already installed APK. It would be very dangerous to allow such a behavior anyway as the whole permissions system is meant to allow the user to first read what permissions an Application requires so he can judge if it is ok or not.
No, sorry, you must request all permissions via the AndroidManifest.xml file.
Yes, i found this line in http://developer.android.com/guide/topics/security/security.html:
Android has no mechanism for granting permissions dynamically (at run-time) because it complicates the user experience to the detriment of security.
Guys now from Android 6.0 Marshmellow onward, you can ask users at runtime to allow permissions dynamically, I found of it, have a look at this link. I hope it will help you getting idea.

Categories

Resources