Titanium Android exposes Context.getExternalFilesDir() ??

You must Login before you can answer or comment on any questions.

Hello,

does Titanium expose the following: http://developer.android.com/reference/android/content/Context.html#getExternalFilesDir(java.lang.String)

I need access to this folder in order to download and store files in sdcard which will be deleted when user uninstalls the app.

Titanium 2.1.2. Android 4.0.x

2 Answers

Check the Filesystem docs for externalStorageDirectory

— answered 10 months ago by Anthony Decena
answer permalink
3 Comments
  • Context.getExternalFilesDir() corresponds to Android/data in the external memory on native developing.

    I tried to do the same by Ti.Filesystem.getFile(Ti.Filesystem.externalStorageDirectory, "Android", "data") but it does not save the file there. Any ideas?

    — commented 10 months ago by Onoma Epitheto

  • if getExternalFilesDir() corresponds to Android/data, then externalStorageDirectory most likely corresponds to the same place. You don't have to add Android/data to the filesystem path.

    — commented 10 months ago by Anthony Decena

  • I tested it. It does not correspond to the same place. externalStorageDirectory creates a folder with name same with your app id to the sdcard and then places your folders/files in there. The problem is that this folder/files ARE NOT DELETED when user uninstalls the app. I need to find a way to remove all files/folders of my app when the user deletes it. It seems so that there is no way to do that with titanium yet..

    — commented 10 months ago by Onoma Epitheto

Your Answer

Think you can help? Login to answer this question!