Android Question ScreenShot Error

rodmcm

Active Member
Licensed User
I am trying out the screenshot posted by agraham on a Levono 10" tablet

https://www.b4x.com/android/forum/threads/how-to-make-screenshots.10199/

and get the error


java.io.FileNotFoundException: /storage/emulated/0/Test.png: open failed: EACCES (Permission denied)

I am seeing the same error when trying out other screenshot offerings as well.. Can someone please advise. The permissions list includes WRITE_EXTERNAL_STORAGE which I understood is automatically set by a call to File.DirRootExternal

I also notice that all of the screen shot programs save to external storage. Is it possible to save to internal storage and then transfer to 'Gallery"
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

rodmcm

Active Member
Licensed User
Sorry DonManfred.. Can u elucidate a little further
I have the following in the manifest

AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
 
Upvote 0

rodmcm

Active Member
Licensed User
Thanks for that.. I had assumed the compiler would automatically add the permissions when there was a call to File.DirRotExternal
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I had assumed the compiler would automatically add the permissions when there was a call to File.DirRotExternal
Your assumption is correct. It does add the permission to the manifest. However you still need to request it at runtime (it wouldn't have worked if the permission wasn't listed in the manifest).
 
Upvote 0
Top