Ensure Maven Central is present in your project’s build.gradle:

allprojects {
    repositories {

Then add the following compile statements to the dependencies section in your module’s build.gradle:

dependencies {
     // Existing dependencies may go here
     implementation ''
     implementation 'com.squareup.okhttp3:okhttp:3.11.0'
     implementation ''

Then sync your project.


To your pom.xml, add:


In your IDE, build your project (or run mvn compile), then see the configuration section below.

With Ant, other build tools, or manually

Download the JAR for the latest version, as well as the Gson library and OkHttp3 library. Place these in a /lib folder in your project and add them to your project’s classpath.

Configuration and usage

In AndroidManifest.xml, add the following permissions beneath the manifest element:

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

Inside the application element, add the following:

<meta-data android:name=""
           android:value="PASTE_YOUR_API_KEY_HERE" />

Replace the value in meta-data with your API key, available from your Raygun dashboard under Application settings.

Add the following imports to the starting activity of your application:


In a central activity method (such as onCreate()), call the following:


If you wish to use Real User Monitoring without network performance logging, use the code below.

boolean withNetworkLogging = false;
RaygunClient.attachPulse(this, withNetworkLogging);

Provide a user identifier

By default, each user will be identified with a unique guid. If possible, we highly recommend providing your own unique identifiers for your users which can be done as follows. The first string parameter can be any unique user id you want - email address is just a recommended example.

RaygunClient.setUser(new RaygunUserInfo(email, firstName, fullName, email, null, false));

Real User Monitoring messages will be sent to Raygun as soon as the app starts up. So once you’ve set up Real User Monitoring in your app, run it up and go to your Real User Monitoring dashboard to see the data it collects. Of course Real User Monitoring is most valuable once your app is out there in the store.


Real User Monitoring will automatically record information about views when attached. You can filter out the reporting of view information by view name.

RaygunClient.ignoreViews(new String[]{ "MainActivity" });

Network calls

Once Real User Monitoring is enabled, Raygun4Android will automatically log the performance of network calls made with the following methods.


You can also manually log the timings of network calls using the following Raygun4Android API.

RaygunClient.sendPulseTimingEvent(RaygunPulseEventType.NETWORK_CALL, "GET", 1234);

The name string can be whatever works best for you - the HTTP method and url is a recommended example. The duration is the milliseconds that you’ve measured the network call to take.

Details about the network calls that you log can be found in the Performance tab of your Real User Monitoring for mobile dashboard.

Filtering network calls

If you don’t wish the performance of certain network requests to be logged, you can filter them out by URL.

RaygunClient.ignoreURLs(new String[]{ "" });