Skip to first unread message

Ale

unread,
Feb 3, 2017, 3:56:45 PM2/3/17
to mitappinv...@googlegroups.com
I tried to do an app which creates a .nomedia File in a definied path, the user can define this path. Now everything works but I can't save on the external SD Card. On mySamsung Galaxy S5 it won't work but on my S3 it works fine on all Storages. Now I found out that Android 6 Needs to request the permission during the runtime of the app. In the normal Java  and co. no Problem (copy the Code from the Websites below (?)) but Appinventor can't do that. Is there an extension which can do that or is that planned by someone? I think that would  be  necessary in the next years, every critical permission needs this procedure.

Here my sources:
It would be grat if someone can help me with this, can I do an Extension for myself? (If yes, how?) Is there already one? Can someone do it?  Or can I export the code somehow to my computer and try to Import the code from the Website into mine?  Other ideas?

Thank you very much for your help.
~Ale

Taifun

unread,
Feb 3, 2017, 5:38:48 PM2/3/17
to MIT App Inventor Forum
you can try the file extension https://puravidaapps.com/file.php and its Copy method

can I do an Extension for myself? (If yes, how?)
more information about how to create an extension see the App Inventor Extensions document
however that will be more advanced and will require some Java skills...

the max API Level for extensions is currently 22 (Android 5.1)

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 


Ale

unread,
Feb 3, 2017, 5:48:54 PM2/3/17
to MIT App Inventor Forum
May, u remember me, I asked here before, it won't work with your extension, It needs the permission too, thats just logic.
So the extension won't work on an Android 6 device like my S5? Your extension works (but not on the exst, SD). Or does that mean that I can't ask for the permission by the user 'cause this is an android 6 thing?
May you are planning an extension for this? Or how does it look for an easy solution for my problem? xP

Thats the reason why your extension won't work on  ExtSD's by APIs over the one in the links described. The permission on the AndroidManifest must be accepted by the user in the runtime of the app!

Taifun

unread,
Feb 3, 2017, 6:01:04 PM2/3/17
to MIT App Inventor Forum
May, u remember me, I asked here before, it won't work with your extension, It needs the permission too, thats just logic.
sorry, I don't remember

I do not have a device having an external sdcard, several user reported different results, you might want to read the notes below the Copy method here https://puravidaapps.com/file.php

 Or does that mean that I can't ask for the permission by the user 'cause this is an android 6 thing? 
you can't write an extension, which uses features of Android 6+ and to ask for permission is one of these features

Or how does it look for an easy solution for my problem? 
the easy solution is to use the internal sdcard

Taifun

Ale

unread,
Feb 4, 2017, 6:52:20 AM2/4/17
to MIT App Inventor Forum
No problem, now u know.
A lot of users are having devices with extstorages and a lot of users are having the EACCESS error by trying to save  something on the ext SD with your Extension.
The users which are having Android 6 or higher probably have the same Problem like me, they must ask for the permission  during runtime.
Hm, bad problem, I hope there comes an update for the AI2.
That's funny..... I want do hide datas on my external SD Card because I don't want them in my gallery, then I  should save the nomedia file on the internal? = no sense. Sorry but this Application just works if i can use the external storage too.

Taifun

unread,
Feb 4, 2017, 10:15:37 AM2/4/17
to MIT App Inventor Forum
 I want do hide datas on my external SD Card because I don't want them in my gallery, then I  should save the nomedia file on the internal?

try to store your images in a folder in the internal sdcard and start the foldername with a dot, for example

.myImages

Taifun
Reply all
Reply to author
Forward
0 new messages