Android - user permission for contacts and location info - android

By default, my android app which I am developing needs the location and the phonebook of the user who installs the app. The counterpart iPhone app pops up with the dialog and ask for user authorization to use both the address and the location info. Whereas, in Android I am not seeing any pop up or restriction in both the simulator as well in the actual physical device in which I am testing.
Can I safely presume that all apps once installed in the android environment will be granted both the location and phone book contact details. Please let me know. If not, is there a way of setting the permission through code or prompt the user for authorization in android?
Thanks for your time and help.

On Android, permissions like these are presented to the user at install time and they must accept them all to continue with the installation so yes.

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.

Related

If a user denies access to the camera in codename one can you find out from code

When you open the camera the user is prompted to grant the app permission to access the camera.
Is there any way in Codename one to tell if the user has denied this permission?
With either a callback or some kind of global call?
This specific to iOS but with the recent updates to Android the same question is also relevant there.
This is now built in to the CodenameOne platform - https://www.codenameone.com/blog/switching-on-android-marshmallow-permission-prompts.html
Currently we haven't enabled the Marshmallow permission prompts by default in part due to the lack of an API to indicate that.
We have a standard API for contacts permissions which we needed in iOS and most of the API's should be ready for Marshmallow since iOS always had the ability to deny permissions.
But we need to re-think the API's for querying that detail and whether we want them to follow the style of isContactsPermissionGranted.
I noticed there is no issue to track the progress of this so I filed it.

Android checking network operator upon installation

I am building an android app, which is restricted to users only using a particular telecom network. And i don't want users who are not on that network to be able to install the app.
So i wanted to know if it is possible to check on which network operator the user is when installing the app.
Thanks.
No. The app cannot run any code while it is installing, or, before installation. Any code will be executed after the app is installed.
What you can do is, after the app is installed, check for network operator. If it is the desired one, let the user use the app. Else, deny any further access.
You can also ask the user to uninstall the app by creating a new Intent with Intent.ACTION_DELETE and specifying the package name. It will give the user an option to uninstall the app.

Device Pin before installing APK

My use case is, My app should verify the device pin/password is set. if not then enforce the user to set it up. This has to be performed every time user launches my application and proceed after verification of the pin/password. Can some please help how to implement this. I am using apache cordova and jquery for my application development.
This would be plausible if there were, say, a manifest permission you could add since Android checks the permissions before installing the app, but there isn't that option... Personally, I wouldn't enter my phones "master password" into an app. Too sketchy. Your best option is to create your own password system handled by your app. So whenever the app is run (or whatever your specific need is) you can ask the user to input his password.

Check whether application is installed or uninstalled

Can I define that application was installed earlier? For example I can check whether application is installed or not installed but if application was installed and later was uninstalled. Is there way to check it or not?
Phone does not store any information about the uninstalled app. If ur app has a backend, then try saving UDID in the server when app is installed. So that u can check next time whether the app is once installed and uninstalled in a phone. But if ur app is a stand alone app with out any server, u cant do that.
Uninstalled apps are per default leaving no trace on the phone.
If it is your own app you want to check whether was installed and later uninstalled you could code your app to leave a trace, either on a server (sending the phone ID to the server) or on the SD Card. Both methods requires permissions.
If it isnt your own app you want to check whether was installed and later uninstalled you are out of luck, sorry.
You could create a file on the SD card when the application is installed the first time.
Then when it's reinstalled, your application will check the presence of this file.
If you are supporting FCM in your app .
Than have a look at the server side api for sending the notifications
If sending fails to a user , we can consider that user has uninstalled the app.
Have a look at the following article.
https://medium.com/what-is-singleton-pattern-and-why-we-need-them/how-to-track-uninstalled-users-from-app-using-fcm-afdba7301116
I haven't gone though backend apis for FCM. not sure whether we get this info while pushing out a notification to a single user or a group of users.
my intention is that try for FCM if it useful for you to determine the install/uninstall status

How to prevent a user from installing applications which uses some specific permissions

What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.
Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?
What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.
Write your own firmware, where you replace the normal installer mechanism with one that enforces your desired criteria.
Android SDK applications cannot interfere with application installation.
Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?
No, sorry.
However, you can listen for ACTION_PACKAGE_ADDED and examine the newly-installed package via PackageManager, and alert the user at that point. Since nothing of the installed package can run immediately upon the install, I would think that there is a decent chance that your alert will appear before the user tries to use the newly-installed app.
In the future this would be probably something you could do trough Device Administration, but right now limiting application installation based on its requested permission is not included.
One option is this snippet that decompress the apk and extracts the AndroidManifest.xml.
By the way the aapt tool for android runs on the Android OS too. You can get this information using this port

Categories

Resources