Granting permissions without user interactive screen - android

I am developing an Android application which is suppose to run on an embedded device which does not have UI. My application uses various permissions for which usually Android system will present user to grant permission. This is not possible in our case because the device does not have any screen. What is the way to grant permissions in this case. Note that, we can publish this app as System app as we can build our own firmware too but not sure about how to get past this user prompt.

As you have already said you are going to publish this app as system application
you also need to mention this in your manifest file
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>

Related

Android Studio Debugging does not demand for permission?

A small question: I am trying to debug my App, developing in Android Studio, with my Smartphone. I have listed several uses-permission in my manifest. But when I debug the app, the smartphone does not ask me for the permission to use the permissions... will I nevertheless have access to my "uses-permission" permissions? If not, how can I debug it :D
Runtime permissions are a new thing on Android. They only work if your both Target API and the device you are using are level 23 or higher. If any of those is lower, then Runtime permissions do not work and old permission model is used. In old model, permissions are granted at install time and when you install your app via USB, you automatically accept all permissions. Still, in new permission model, you need to write code in async style, meaning that first you have to ask user for permission and supply a callback, in which you will know whether the user granted or denied specific permission. You can read more about that at officials docs.

Asking permission for Application update

I am going to update an application to Android 6.0. For users who already have the application installed when an update is made, are all the permissions still active or is the user going to be asked for permissions that are in the dangerous category?
It will still ask them to allow those permissions if they are in the dangerous category, regardless if they are specified in the manifest. (i.e Writing to SD, Using the camera) See Permission Groups
If you have users who are on Android 6.0 Marshmallow and your application only specifies permissions in the manifest and not at run time then those actions will fail. For example, if you have code that writes to the external storage, it will fail and give a Permission Denied error.

INTERNET permissions in Android M

Regarding Google's recent announcement about Android M and Permissions model.
Per the official Android documentation:
Limited Permissions Granted at Install Time: When the user installs or
updates the app, the system grants the app all permissions that the
app requests that fall under PROTECTION_NORMAL. For example, alarm
clock and internet permissions fall under PROTECTION_NORMAL, so they
are automatically granted at install time. The system may also grant
the app signature and system permissions, as described in System apps
and signature permissions. The user is not prompted to grant any
permissions at install time.
Particular note that it says:
...the system grants the app all permissions that the app requests.
So, if the app does not have INTERNET permission in its AndroidManifest.xml, it won't be granted access to INTERNET in that case?
Or will an app require to add INTERNET permission in its manifest in order to be able to make network calls?
As for the specific android.permission.INTERNET permission, it is still mandatory for apps that will access the Internet. If a developer were to publish an app without defining it in the Android manifest, an exception will be thrown the first time a connection attempt is made, and the app will possibly crash. This is no different than before.
All that has changed is that there won't be a prompt to the user, the app will still require the permission in the manifest.
Please check this video from Google IO - https://youtu.be/f17qe9vZ8RM?t=18m10s
There is no more Internet permission - the app will have by default access to the internet. Their idea is that if you don't have access to the device data then you can not do anything dangerous
Kind Regards

is there a way to get realtime permession access by an app on rooted android phone?

I'm trying to get all the permission of 3rd party apps in real time. I can get static permissions from the manifest file but want to know is it possible to obtain live permission access from other apps. is it possible to get from the system log files?
XPrivacy is a tool which is able to inform you about permissions asked by any app on your device. You can allow the permission or deny it. It's more of a privacy tool but it can show you permissions of any app currently running.
If you plan on installing XPrivacy, you better use this installer

Can Android apps request additinal permissions at runtime?

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.

Categories

Resources