Closed ginatrapani closed 11 years ago
Related to #143 - we're blindly placing temp files on the SD card.
Why is the data stored on external SD, can't it be stored in app specific storage in /data/data. This will also fix #143
I think we should keep the files in external storage. Internal storage is not directly accessible by the user, which goes against the core philosophy of todo.txt, in that the file should be editable in any plain text editor and not require any specific apps, including Todo.txt or Dropbox.
That said, we should not crash when external storage is inaccessible. We should use the getExternalStorageState() method to determine whether it is available, and handle the error case appropriately.
After some thought, Mark convinced me that using application storage makes sense, since we're syncing from Dropbox anyway and you can edit the file from any editor via the Dropbox app. So, d9eec52c0bb9c07d777599724637ad96e1d256e3 addresses this issue, but there are 2 outstanding todo's:
Force close error if there's no SD card or it's full
Stack trace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.todotxt.todotxttouch/com.todotxt.todotxttouch.TodoTxtTouch}: com.todotxt.todotxttouch.TodoException: Could not create dirs: /mnt/sdcard/data at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769) at android.app.ActivityThread.access$2500(ActivityThread.java:129) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2117) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:4717) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) at dalvik.system.NativeStart.main(Native Method) Caused by: com.todotxt.todotxttouch.TodoException: Could not create dirs: /mnt/sdcard/data at com.todotxt.todotxttouch.util.Util.createParentDirectory(Util.java:322) at com.todotxt.todotxttouch.util.Util.createParentDirectory(Util.java:317) at com.todotxt.todotxttouch.task.LocalFileTaskRepository.init(LocalFileTaskRepository.java:61) at com.todotxt.todotxttouch.task.TaskBagImpl.reload(TaskBagImpl.java:70) at com.todotxt.todotxttouch.TodoTxtTouch.initializeTasks(TodoTxtTouch.java:211) at com.todotxt.todotxttouch.TodoTxtTouch.onCreate(TodoTxtTouch.java:186) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717) ... 11 more