Android Question Upgraded B4A / Files and media permissions denied

almontgreen

Active Member
Licensed User
Longtime User
I am trying the new Exoplayer and new B4A ver. 10.9 and I want to play an mp4 off the local storage in directory /001/test.mp4 I created the directory and copied the file using ftp onto the device. File and media permission is denied according to the info on the device.

Is there a permission I need in the manifest editor? I put these:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

and others but nothing I've tried works. (many of my old libraries don't work now either, so I removed.) It compiles and installs now but with permissions denied.
 

almontgreen

Active Member
Licensed User
Longtime User
That returns a directory I can't access:
/storage/emulated/0/Android/data/b4a.example/files
my video file is in:
/storage/emulated/0/001 directory and I can't open it.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Upvote 0

almontgreen

Active Member
Licensed User
Longtime User
Yes, been reading but I learned that the Android TV Box X96 X6 makes you go into the settings to allow permissions. It doesn't happen automatically on install with B4A. Once I did that the files were accessible and stayed accessible. I am VERY concerned that so many of the libraries I have used over the years with B4A now do not compile. I am starting to believe the MQTT part of my application will no longer be possible to program. And I'm never going to use cross platform development so all of the pages stuff seems to be a tedium that I'm not going to need. Still, B4A is a very powerful tool that I was happy to pay for and repurpose TV boxes to do other cool things.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I am VERY concerned that so many of the libraries I have used over the years with B4A now do not compile. I am starting to believe the MQTT part of my application will no longer be possible to program. And I'm never going to use cross platform development so all of the pages stuff seems to be a tedium that I'm not going to need. Still, B4A is a very powerful tool that I was happy to pay for and repurpose TV boxes to do other cool things.
Everything written here is wrong.
1. The are very few libraries that no longer work and the reasons that made them stop working is not really related to B4A but rather to new requirements in newer versions of Android.
2. Nothing has changed regarding to MQTT.
3. You are not forced to use B4XPages though once you understand it you will see that it makes things 100 times simpler.
 
Upvote 0

almontgreen

Active Member
Licensed User
Longtime User
I apologize for not stating things more precisely. Yes, the problem is not B4A but with Android and all of the requirements in the new version. I understand that now. I have an "old" program that when I installed the new B4A -it would not compile. When I removed the libraries, and the parts of the program that called those libraries, it no longer crashed. The problems seemed to be mostly network related. I have not kept up with all of the changes and now have a reason to repurpose my app. I understand I can rewrite it from the ground up, but I'm not sure with all of the new restrictions that it will work. It would seem I have a great deal of learning to do but what worries me is that at the end of the day, due to Android, I may not have something that will work. It has to run on new hardware so I don't think running the old version is an option. I am a huge fan of B4A and I figure the time investment learning is worth it. I have been watching and reading and I hope you don't get too cross with me as I navigate these new waters. As to #3 of your response, of course once you understand - everything becomes 100 times simpler! Getting to that point is not so simple. I will try my best to post with greater precision and after I have exhausted using all of the resources you have generously provided.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
all of the new restrictions that it will work.
The main 'killer' resrtiction is probably file system access unless you want to intercept SMS messages and phone calls which is now generally not permitted for non-default apps. If you don't need to put your app in the Play Store then you can restore file system access on an Android 11 device like this
Manage External Storage - access internal external storage >= SDK 30 | B4X Programming Forum
You will still need to use the ExternalStorage class if you want to access an SD card.
ExternalStorage - Access SD cards and USB sticks | B4X Programming Forum
 
Upvote 0
Top