Android: How to write to the Android/data/app.path/files directory -
so want write data file in location users can access manually. goal provide easy-to-access crash log can sent, without folks having full logcat.
the 1 location on internal storage filesystem i'm aware of can written app /storage/emulated/0/android/data/my.app.package/files
. goal, however, have path platform-independent possible.
i can /storage/emulated/0
part using environment.getexternalstoragedirectory()
. it's android/data/my.app.package/files part i'm concerned about. want avoid hardcoded paths avoid differences between devices.
so there utility method out there can me? i've tried context.getfilesdir()
, gives me /data/user/0/my.app.package
, isn't accessible user without root.
getexternalfilesdir
want use https://developer.android.com/reference/android/content/context.html#getexternalfilesdir(java.lang.string)
Comments
Post a Comment