Disclosure: Sentry is sponsoring the Hack & Tell


Today is both a sad and exciting day for me and the Sentry community. I happy to announce that Sentry’s raven-java client now has proper for support for Android. I am sad to announce that this means the deprecation of my Sentry-Android client that I have been maintaining since June 6th, 2013.

Sentry’s Acceptance of Sentry-Android

One of my favorite parts of Sentry has always been the love and dedication both the team and product have for the open source community. Sentry’s entire code base, from the backend and web dashboard to all of the frontend clients, are available on GitHub. This approach allows Sentry to guide the product while still collaborating with those outside the company to make continuous improvements. The Sentry team is made up of talented engineers that make a great product by themselves, but allowing the open source community to contribute bug fixes and new features is the cherry on top.

Sentry is also very welcoming to new third-party clients — which is where Sentry-Android comes in. Since Sentry- Android’s inception, Sentry welcomed it as a library that filled in an important gap in their offerings at the time. We have always been a huge fan and heavy users of Sentry at RokkinCat on a wide variety of web projects, but had never used Sentry in a mobile application. At the time, they did have a Java client, but it was geared more towards Java backend applications and lacked Android-specific features. Sentry’s documentation for third-party SDK creation made it substantially easier to extend Sentry for use in the context of a mobile application. The first version of Sentry-Android was done in a few hours, and it contained only the core features of sending up simple messages and unhandled exceptions.

At this point, I figured that if I had a need for a simple Android client for Sentry, others probably did too. I published it to GitHub and the community feedback was pretty outstanding: my repository was being starred by people I didn’t know, I had StackOverflow posts being asked about my library, and it was even listed on the Sentry website as a third-party SDK.

My Love Letter To Sentry and Sentry-Android’s Contributors

Dear Sentry,

Thank you for being a huge proponent of the open source community since your beginning. All the time your team has dedicated to the issues, pull requests, and supporting of third-party SDKs truly shows how much you care about your product and your users. Even though I will be phasing out Sentry-Android in favor of raven-java, I am proud to have been accepted into this community for the past 4 years.

Love always,

Josh Holtz

@joshdholtz



Dear Sentry-Android Contributors,

You all have been the reason Sentry-Android was a success. I made Sentry-Android for me but you all are what made this library for Sentry’s Android community. I would especially like to thank Marc O’Morain for doing exceptional work the past year on adding new features and improving the code quality of Sentry-Android. I could definitely have not done this without you either!

This process may be a little bit of work for all of you upfront but this is the right direction to go. Using a Sentry supported library will get you all features faster and provide better support than I could personally provide. If the client does not have everything you’d like, please don’t hesitate to open pull request on raven-java!

Love always,

Josh Holtz

@joshdholtz


Sentry-Android Migration to raven-java

Enough mushy talk. Let’s get down to business. Below is a high level migration to get you started with raven-java.

Gradle

Replace:

compile 'com.joshdholtz.sentry:sentry-android:1.6.0'

With:

compile 'com.getsentry.raven:raven-android:8.0.1'

Permissions

Make sure you have both of these:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Initialization

Replace:

Sentry.init(this, "YOUR-SENTRY-DSN");

With:

Context ctx = this.getApplicationContext();
Raven.init(ctx, "YOUR-SENTRY-DSN");

Capture Events

Replace:

Sentry.captureEvent(new Sentry.SentryEventBuilder()
	.setMessage("Being awesome")
	.setLevel(Sentry.SentryEventLevel.ERROR)
);
EventBuilder eventBuilder = new EventBuilder()
                              .withMessage("Being awesome")
                              .withLevel(Event.Level.ERROR);
Raven.capture(eventBuilder.build())