Android Question Working out which Runtime Permissions is required

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am trying to get my head around the runtime permissions.

Under the IDE log it has 'List permissions'.

In the image below is the list of permissions it has listed for my app.

Do I need to request each of those permissions, or is there one that I request that might request multiple at the same time?
(I understand I only need to request it the once, even knowing it's listed multiple times)

I noticed that

(I know the Write_external_storage permission could be removed by using GetSafeDirDefaultExternal.)

Also what about the last permission. (${applicationId}.permission.C2D_MESSAGE) how do I request that one? How do I request that one, as it looks like it's referencing the application ID ?

permissions.png
 

DonManfred

Expert
Licensed User
Longtime User
(${applicationId}.permission.C2D_MESSAGE
is set in the manifest. It is not a dangerous permission.

You need to use runtime permissions lib for all DANGEROUS Permissions. All with a * at the end in the List....
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
BTW, you don't really need to handle WRITE_EXTERNAL_STORAGE permission if you follow the runtime permissions tutorial.
Do you mean:

Use RuntimePermissions.GetSafeDirDefaultExternal("") instead of File.DirDefaultExternal. The parameter passed is an optional subfolder that will be created under the default folder.

If so, then when I create a SQL database then it's visible to other apps.

I was using File.DirInternal and it's not visible to other apps, but requires the WRITE_EXTERNAL_STORAGE permission.

Unless there is something I am missing or if there is another way in doing it?
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
I know what I did wrong.

I am going to use File.DirInternal in the final release but during development (so I can see the database with an external app) was using File.DirDefaultExternal.

Soon as I switched to File.DirInternal it no longer requires this permission.
 
Upvote 0
Top