Our application has a large amount of C++ code that creates its own log file as a simple .txt file. It's a circular buffer so it's limited to the size we specify. It's also placed in whatever directory we specify.
The problem is where to place the file so it can be accessed with ADB or a similar tool (without rooting). If we didn't care about the publicly-accessible part, it seems this would be the logical place to locate the file:
Make sure that you have the permissions to read and write the External SD using this code in the Manifest File:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
And then this string will give you the wanted path:
String directory = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/" + getContext().getPackageName();