austgl / transdroid

Automatically exported from code.google.com/p/transdroid
GNU General Public License v3.0
0 stars 0 forks source link

Move the ./Transdroid from the root of the sdcard #316

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Follow the recommendations on 
http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

Any files an app creates or reads should be located in 
/Android/data/<package_name>/.

This will help with sdcard clutter.

Original issue reported on code.google.com by kellans...@gmail.com on 25 Apr 2011 at 4:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
My suggested fix:

src/org/transdroid/preferences/ImportExport.java line 20 change to:

public static final String DEFAULT_SETTINGS_DIR = 
Environment.getExternalStorageDirectory().toString() + 
"/Android/data/"+this.getPackageName()+"/data";

Might also want to check if the old config json file exists and move it.

Original comment by kellans...@gmail.com on 25 Apr 2011 at 5:10

GoogleCodeExporter commented 9 years ago
You would think that (and it was my first approach) but there is a problem with 
that firectory (which is actually the result of calling 
getExternalStoragePublicDirectory()): it is removed on update or unintall of 
the application. That would mean it looses the settings file every time you 
update or uninstall Transdroid - which kind of was the reason to have a 
persistent settings file in the first place. Since there is no common directory 
to store really-persistent files on the SD card I opted for this approach 
instead. Also, you can specify your own directory.

Original comment by erickok@gmail.com on 26 Apr 2011 at 7:27

GoogleCodeExporter commented 9 years ago
Oh, wow. That's good to know. Thanks for the explanation!

Looks like that's a bug, actually: 
http://groups.google.com/group/android-developers/browse_thread/thread/b68d40b1f
13e12df/68fae7adf5c545f6

Original comment by kellans...@gmail.com on 27 Apr 2011 at 12:00