Writing to the app's private directory "just works" using os.abspath('./foo') etc. When I need to share data with other apps, I'll use the Environment methods to get the appropriate folder. Here's some code I used recently that just shows you a variety of things that also worked.
def get_save_root(self):
if platform == 'android':
from jnius import autoclass
Environment = autoclass('android.os.Environment')
if Environment.getExternalStorageState() == Environment.MEDIA_MOUNTED:
#root = Environment.getExternalStorageDirectory().getAbsolutePath()
root = Environment.getExternalStoragePublicDirectory (Environment.DIRECTORY_PICTURES).getAbsolutePath() + '/'
else:
#root = context.getExternalFilesDir().getAbsolutePath()
root = os.getcwd() + '/tmp/'
else:
root = os.getcwd() + '/tmp/'
#root += '/knapps_apps.reduce/'
self.save_root = root
return root
I'm sure you can infer that I employed this code here:
And also that I would appreciate a download and good rating since I'm currently trying to get it into search rankings so that it can find its own way ^_^