Skip to main content
Participant
October 19, 2015
Question

getExternalFilesDirs() - How do we write to external sd card for android 4.4 and above?

  • October 19, 2015
  • 1 reply
  • 1274 views

We are making an app in adobe air in which we want to save files downloaded from the internet. We would prefer that this is stored to the external sd card since the filesize is big.

Now according to this link - ((http://developer.android.com/guide/topics/data/data-storage.html#AccessingExtFiles))  since Android 4.4 - we dont need any permission to write to your apps = private directories.

We have been able to store the downloaded files to the "external partition" of internal memory. We want to be able to store the files on "external sd card" if it exists.

There is a function - getExternalFilesDirs() which enables this . What is the alternate function in Air (actionscript) to run this function?

Thanks & Regards,

This topic has been closed for replies.

1 reply

Inspiring
October 21, 2015

First you will need to declare the permissions to WRITE_EXTERNAL_STORAGE in your app manifest.  The external storage can be found through the documentsDirectory, see:

Adobe Flash Platform * Working with File objects in AIR

Participant
October 23, 2015

Thanks for your answer.

I have given WRITE_EXTERNAL_STORAGE in my manifest. Files.documentsDirectory,Files.userDirectory,Files.desktopDirectory all points to external part of my internal storage and not external sdcard. I want to write data to my EXTERNAL SDCARD. How can i do that?