SendLog
was originally released as an app to
Google Play.
Due to
changes in READ_LOGS permission in Android 4.1,
the app became a bit useless.
TL;DR: an app can only read it's own logs.
That is why I decided to open source it so that you can include it in your own app.
- Add a dependency to sendlog-library
- Extend
SendLogActivityBase
and implement one method - Add your activity to the manifest with translucent theme
- Start the activity at a suitable point in your app
There is a sample project sendlog-userapp
which demonstrates all the steps
described below.
If you're using Maven you can simply add this dependency
<dependency>
<groupId>org.l6n</groupId>
<artifactId>sendlog-library</artifactId>
<version>2.0</version>
<type>aar</type>
</dependency>
Otherwise you can just download the source and reference it.
Create an activity called SendLogActivity
in your project which extends
org.l6n.sendlog.library.SendLogActivityBase
.
Implement the following method
@Override protected String getDestinationAddress() { return "android@L6n.org"; }
.
Obviously you should use your own email address instead of mine for users to send their logs to.
In your manifest, add the activity created above
<activity android:name=".SendLogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
Somewhere in your app you'll want to allow users to send the log,
for example in a Help or About menu.
startActivity(new Intent(this, SendLogActivity.class));
That's it!