Android Question where to CheckAndRequest

catster

Member
Licensed User
Longtime User
What is the best place to call CheckAndRequest if I need PERMISSION_WRITE_EXTERNAL_STORAGE as early as possible?

I known I cannot call checkandrequest in starter service. But seems android can start with any activity.

I have a database wrapper service receive request and write to database. What is the best practice to get folder permission for this service? I do not prefer RuntimePermissions.GetSafeDirDefaultExternal because the database file is shared across applications.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
I known I cannot call checkandrequest in starter service. But seems android can start with any activity.
Best not to use starter service or activities.

Put it in B4XMainPage with B4XPages.

And remember that if it is a Google Play app then the external storage permission is irrelevant.
 
Upvote 0

catster

Member
Licensed User
Longtime User
Thanks Erel. What is the proper way of sharing a file across two apps without PERMISSION_WRITE_EXTERNAL_STORAGE ? seems GetSafeDirDefaultExternal cannot be shared across two apps.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0
Top