You can Use ready APi Such as BugSence and crittercism
After implementation SDK you will recive crush report
with crush logs to your email if you whant
For BugSance
Download SDK
import com.bugsense.trace.BugSenseHandler;
Make sure you also add the line
<uses-permission android:name="android.permission.INTERNET" />
to your app's AndroidManifest.xml file. BugSense uses this permission to send the crash reports and performance metrics.
add the BugSenseHandler in your activity before setContentView. Then you are ready to go!
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BugSenseHandler.initAndStartSession(Context, APIKEY);
setContentView(R.layout.main);
//rest of your code here
}
The InitAndStartSession method installs the BugSense exception handler and the performance monitor. It then sends all the previously saved crash reports and performance metrics. At the same time, it starts a new session for your activity.
Here's an example on how to use the InitAndStartSession:
BugSenseHandler.initAndStartSession(MyActivity.this, "YOURAPIKEY");
Whenever you want to explicitly start the session, you can use the startSession method at the onStart method of your activity, as follows:
BugSenseHandler.startSession(MyActivity.this);
Whenever you want to close the session, you can use the closeSession method as follows:
BugSenseHandler.closeSession(MyActivity.this);
Close session will close the current session, offering better tracking of the sessions for your users.
If you want to manually flush all the saved data, use the BugSenseHandler.flush(Context) method:
BugSenseHandler.flush(MyActivity.this);
More Documentation Android BugSence Doc