jeudi 19 janvier 2017

Does Android 6 app need some other permission or user authorization to write to external storage?

I have and AIR application that have been working almost 2 years. In the beginning of the app, I'm checking is there a folder in documents directory for storing images. That was working just fine since last update.

in app.xml I have:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Folder is regularly created...

public class FileManager {
    public static var MainFolderName:String = "FolderNameToCreate";

    public static function managerInit():void {
        var mainFile:File = File.documentsDirectory;
        mainFile = mainFile.resolvePath(MainFolderName);
        if (!mainFile.exists) {
            mainFile.createDirectory();
        }
        .......
    }
....
}

If I omit this, application is working, mean can be initialized, if not (new instals) cannot open, app crashes. After one of crashes I have open permission settings for app and see that Storage permission is off? I enable it, and after that app works. I have tested it on Note 4, with Android version 6.0.1.

Is there any additional authorization for using external storage?

Aucun commentaire:

Enregistrer un commentaire