An application should be able to save its temporary and persistent data. Sometimes data should be written into a folder on external storage accessible by other applications. Let's find out how to get the path to this folder on Android and Windows, and do this in a portable way.
If your Android smartphone unmounts its external storage while connected to a desktop computer, make sure you disconnect it and wait for the storage to be remounted.
We need to write some Java code to accomplish this task. First, we will ask the
Environment
for the external storage directory and its suffix, so we can distinguish our data from other applications:protected String GetDefaultExternalStoragePrefix() { String Suffix = "/external_sd/Android/data/"; return Environment.getExternalStorageDirectory().getPath() +Suffix + getApplication().getPackageName(); }