This is a simple example that demonstrates a recommended method of sharing code and files between B4A, B4i and B4J. It is based on these tips: https://www.b4x.com/android/forum/threads/xui2d-cross-platform-tips.96815/#content The main idea is to implement everything that is possible in one or...
www.b4x.com
what is the best way to call the Runtime Permissions, since they only work in an Activity?
I have a button that only asks for permission when he presses this button (save image in gallery), if he does not click this button he does not need this permission.
Edit: The general advice is always check run time permission just before youyour app need it and not in an Activity_Resume. Without seeing any code, I should say in the processing of the button click logic. You can find the details in Runtime Permissions (Android 6.0+ Permissions) post.
I would also recommend giving a detailed, but simple explanation of why your app needs a particular permission before prompting, because the pop-up text that the OS shows a user is often confusing.
Below is some sample code I use to display the reason why my app needs a particular permission so that the user is well informed of why its needed before I let Android display it's cryptic and sometimes dangerous sounding permission prompts, such as "Allow MyApp to access photos, media, and...
No, only ask a user for a permission if the app need it!
I don't think that is need a description if the user press the save in gallery button.
I have already successfully integrated the permissions into my app, my problem is to call the runtime permissions from a class, because you cannot make a wait for, for functions that are in another module.
Till the user withdraws his permission, the user will only see once the permission request. Personally I think that transparency is on the long run the best approach to tell the user why the permission is requested. It gives also the opportunity to explain the consequences when it is not given.
I have already successfully integrated the permissions into my app, my problem is to call the runtime permissions from a class, because you cannot make a wait for, for functions that are in another module.