Android Permissions

Home Forums Monkey 2 Programming Help Android Permissions

This topic contains 17 replies, has 4 voices, and was last updated by  CopperCircle 1 week ago.

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #11088

    CopperCircle
    Participant

    On Android and iOS I normal create a hidden folder using the dot in front (.myfolder) on Android this is normally in the root of external storage, on iOS you can have trouble getting your app through iTunes review depending on where you store data and how much you store, they dont like you storing lots in the Documents directory as that is part of the default iCloud backup, so I use NSCachesDirectory.

    I created modules for my specific needs on Monkey1 and slight modified brl/filesystem module to get it to work on both platforms correctly, I will try and post the modules if helpful.

    #11089

    Mark Sibly
    Keymaster

    On android, any reason you don’t use “internal:”, or if you have large-ish files, perhaps this:

    https://developer.android.com/reference/android/content/Context.html#getExternalFilesDir(java.lang.String)

    …which apparently requires no special permissions on KitKat+, so I was thinking of making it the “external:” of choice for monkey2 (which currently doesn’t even support “external:”). Root dir of external can be made available differently. I’m guessing getExternalFilesDir it’s the one we’re supposed to use anyway.

    It would definitely be useful to find out some of the needs people have for fileio, and what the best approaches are. For example, I take it people want acces to media dirs like pictures, music etc. Anything else?

    Any suggestions for general filesystem (or other) module improvements would be greatly appreciated too – feel free to post any source code you have!

    #11090

    CopperCircle
    Participant

    I am not sure there is any right way on Android, you look at the filesystem on your phone and you see apps storing stuff all over the place!  But that looks good for default external, for my particular uses I am creating/deleting folders and files, checking storage space and getting a list of files from folders.

    I am downloading large amount of big files from a web server and storing them locally also creating images in the app and storing them locally.

    I use brl/filesystem/stream for storing stuff from within the app to local storage, I just had to re-write the CreateDir function recently for iOS to make it compatible with new iOS versions:

    I then have a async download/store module that can download files from a server and store them locally in the background.  It also has some functions to list folders, check space and such.  This is all created for my specific needs but this sort of stuff is all very useful.

    https://www.dropbox.com/s/mdgbizmi0wrp0ax/imagecache.zip?dl=0

Viewing 3 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic.