简体   繁体   中英

Monitoring errors with Sentry - Android

I need to implement Sentry for my android app, I try to find an example about how I have to implement this, but I can't find it. I saw the Sentry documentation in http://sentry.readthedocs.org/en/latest/developer/client/index.html#server_name

But I have some questions. If my app crash, the exception will be captured? Should I put this code line into my try/catch? var $resultId = myClient->captureException($myException); (in android code)

If somebody has a sample in android I will be grateful.

Thank you!

I am a little late but I just recently released a Sentry client for Android. It's in its early stages so feel free to pull request any changes that you see.

https://github.com/joshdholtz/Sentry-Android

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Sentry will look for uncaught exceptions from previous runs and send them        
        Sentry.init(this, "YOUR-SENTRY-DSN");

    }

}

Maybe try using something like BugSense? http://www.bugsense.com/

If it definitely has to be Sentry, then look at this example: https://stackoverflow.com/a/755151/349012

It shows you how to set your own uncaught exception handler so you can try and upload to Sentry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM