3

I am writing a flutter app for Android devices. I want to be able to access my apps data folder from my PC using windows explorer so I can copy data into it that my app can use. I can see the folder has been created correctly by my app when I view the sdcard folder within android studio, but not when I view the data folder using windows explorer.

I am guessing this is a permissions issue, but am not sure.

I am using path provider 1.5.1 and permission handler 4.0.0

Here is how I am getting permission to read/write from my folder:

Future<void> getPermission() async {
String path;

if (Platform.isAndroid) {
  PermissionStatus permission = await PermissionHandler().checkPermissionStatus(PermissionGroup.storage);

  if (permission != PermissionStatus.granted) {
    await PermissionHandler().requestPermissions([PermissionGroup.storage]);
  }

  path = (await getExternalStorageDirectory()).path;
} else if (Platform.isIOS) {
  // to be written....
}
}

I have added these lines to my AndroidManifest.xml file

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

Can someone point me in the right direction please?

Joe Brewer
  • 33
  • 1
  • 3
  • 1
    https://stackoverflow.com/questions/32789157/how-to-write-files-to-external-public-storage-in-android-so-that-they-are-visibl Also note that you do not have access to that location on Android 10+ (by default), so you may wish to reconsider your content storage strategy. – CommonsWare Dec 20 '19 at 23:47
  • 1
    Reboot your device and you will see it. – blackapps Dec 21 '19 at 05:39
  • @blackapps Thanks - rebooting helped – Joe Brewer Dec 23 '19 at 10:01
  • @CommonsWare Thanks for the link and advice. I'm going to looking into dropbox and google drive integration as well as some kind of basic ftp server on the android – Joe Brewer Dec 23 '19 at 10:02

0 Answers0