Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 4.4 and SD card #275

Closed
ghost opened this issue Aug 31, 2014 · 3 comments
Closed

Android 4.4 and SD card #275

ghost opened this issue Aug 31, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 31, 2014

Following recent changes in Android 4.4, applications are not allowed to write outside of their application folder on the SD card, so GPSLogger should give the ability to create it application folder on the SD card and give the user some kind of choice to select it. Currently if I just select any directory on the SD card (on my Galaxy S4), there is no error but no file is created, and data is silently lost.

@ghost ghost changed the title Feature Request - Android 4.4 and SD card Android 4.4 and SD card Aug 31, 2014
mendhak pushed a commit that referenced this issue Oct 8, 2014
@mendhak
Copy link
Owner

mendhak commented Oct 11, 2014

Version 52 has been released to the market. In my case the path was

/storage/emulated/0/Android/data/com.mendhak.gpslogger/files/

The simple/detailed screen should show you the default path.

If you have ES File Explorer or Astro File Explorer installed, you can click on the path and it will open those apps to the directory.

@mendhak mendhak closed this as completed Oct 11, 2014
@ghost
Copy link
Author

ghost commented Oct 11, 2014

Thank you for the improvement. I may have not been completely clear, but what I called I SD card was actually the external SD card (typically the micro SD card that you insert in your phone), not the built-in main flash memory. On my S4 it would be: /storage/extSdCard/Android/data/com/mendhak.gpslogger/files which is not something people would easily guess. If I ask gpslogger to write files anywhere under /storage/extSdCard that is not /storage/extSdCard/Android/data/com/mendhak.gpslogger it fails silently (an Android 4.4 "feature").
I guess 2 things would be useful:

  • once the path is changed, immediately create a dummy file (and delete it) to check that the application has permission to write here, and tell the user right away if it does not work.
  • have some kind of helper option "to external SD" which would set the path to the above, to save the user from guessing.

Many thanks.

@mendhak
Copy link
Owner

mendhak commented Oct 11, 2014

It's not easy to be clear about this, this has been one of the most confusing topics I've had to read up on. Android classifies things as primary external storage and secondary external storage and Google have done a very poor job of communicating it. See this.

In any case, I think the permission check is much easier, I've just tried a File.canWrite and it does the trick. I'm also going to show a MessageBox to indicate when they've chosen a bad folder. I didn't think to do this in the release just now.

I'll have a think about how to do a helper option, that's not so straightforward to implement though the idea is easy.

mendhak pushed a commit that referenced this issue Oct 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant