How to write a file to external storage in Android 10 using Android Studio

1.7k views Asked by At

File sdcard = Environment.getExternalStorageDirectory(); File file = new File(sdcard, "filename.txt");

1

There are 1 answers

0
Eyosiyas On

For API level 29 and above Use the ACTION_CREATE_DOCUMENT intent action to load the system file picker and allow the user to choose a location where to write the contents of a file. This process is similar to the one used in the "save as" dialogs that other operating systems use. For further information please refer to this documentation.