Android SDK API

New Relic Mobile for Android has an SDK API for customizing how New Relic monitors your app. Below are all the methods in this API. For an overview on how to use the API, see the Android SDK API guide.

crashNow
Throws a demo run-time exception named java.lang.RuntimeException to test New Relic crash reporting.
currentSessionId
Returns ID for current session.
endInteraction
Ends a custom interaction.
incrementAttribute
Increments the count of an attribute. Overwrites its previous value and type each time it is called.
noticeHttpTransaction
Tracks networks requests.
noticeNetworkFailure
Records network failures.
recordBreadcrumb
Records a MobileBreadcrumb event, useful for crash analysis.
recordCustomEvent
Records a custom New Relic Mobile event.
recordHandledException
Records a handled exception. Optionally takes map with additional attributes showing context.
recordMetric
Record custom metrics (arbitrary numerical data).
removeAllAttributes
Removes all attributes from the session.
removeAttribute
Removes an attribute.
setAttribute
Creates an attribute. Overwrites its previous value and type each time it is called.
setInteractionName
Set a new name for an interaction that is already being tracked by New Relic.
setMaxEventBufferTime
Sets the event harvest cycle length.
setMaxEventPoolSize
Sets the maximum size of the event pool.
setUserId
Set a custom user identifier value to associate user sessions with analytics events and attributes.
startInteraction
Create an interaction to instrument a method in your Android app code.
withApplicationBuild
Set a custom build identifier string that is associated with an interaction.
withApplicationVersion
Set an application version to be associated with an interaction.
withInteractionTracing
Globally disable/enable interaction tracing.