public interface Usage
| Modifier and Type | Method and Description |
|---|---|
Usage |
addCrashReport(java.lang.Throwable t,
boolean fatal)
Send Crash Report to the server.
|
Usage |
addCrashReport(java.lang.Throwable t,
boolean fatal,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> segments,
java.lang.String... logs)
Send Crash Report to the server.
|
Usage |
addLocation(double latitude,
double longitude)
Send location information to the server.
|
Usage |
addParam(java.lang.String key,
java.lang.Object value)
Add parameter to this session which will be sent along with next request.
|
Usage |
changeDeviceIdWithMerge(java.lang.String id)
Change device id with merging profiles on server, just set device id to new one.
|
Usage |
changeDeviceIdWithoutMerge(java.lang.String id)
Change device id without merging profiles on server, just set device id to new one.
|
Event |
event(java.lang.String key)
Create event object, don't record it yet.
|
java.lang.String |
getDeviceId()
This method returns the Device ID that is currently used by the SDK.
|
Usage |
login(java.lang.String id)
Login function to set device (user) id on Countly server to the string specified here.
|
Usage |
logout()
Logout function to make current user anonymous (that is with random id according to
ConfigCore.deviceIdStrategy and such). |
Usage |
resetDeviceId(java.lang.String id)
Deprecated.
This method is no longer acceptable to change device id.
Use |
Event |
timedEvent(java.lang.String key)
Get existing or create new timed event object, don't record it.
|
User |
user()
Get current User Profile.
|
View |
view(java.lang.String name)
Identical to
view(String, boolean), but without start parameter which
is determined automatically based on whether this view is first in this session. |
View |
view(java.lang.String name,
boolean start)
Start new view.
|
Event event(java.lang.String key)
key - key for this event, cannot be null or emptyEvent.record()Event timedEvent(java.lang.String key)
key - key for this event, cannot be null or emptyto end timed eventUser user()
User object.
Note that even when the CoreFeature.UserProfiles is disabled,
this method still returns an object, yet any modifications to it won't result in any data stored
or sent to the server/
//@ee Feature is not available in Countly Community EditionUser instanceUsage addParam(java.lang.String key, java.lang.Object value)
key - name of parametervalue - value of parameterUsage addCrashReport(java.lang.Throwable t, boolean fatal)
t - Throwable to logfatal - whether this crash report should be displayed as fatal in dashboard or notUsage addCrashReport(java.lang.Throwable t, boolean fatal, java.lang.String name, java.util.Map<java.lang.String,java.lang.String> segments, java.lang.String... logs)
t - Throwable to logfatal - whether this crash report should be displayed as fatal in dashboard or notname - (optional, can be null) name of the report, falls back to first line of stack trace by defaultsegments - (optional, can be null) additional crash segments maplogs - (optional, can be null) additional log lines (separated by \n) or comment about this crash reportUsage addLocation(double latitude, double longitude)
latitude - geographical latitude of the userlongitude - geographical longitude of the userView view(java.lang.String name, boolean start)
name - String representing name of this Viewstart - whether this view is first in current application launchView, you're responsible for its ending by calling View.stop(boolean)View view(java.lang.String name)
view(String, boolean), but without start parameter which
is determined automatically based on whether this view is first in this session.
Creates begin request if this session hasn't yet been began.name - String representing name of this ViewView, you're responsible for its ending by calling View.stop(boolean)Usage login(java.lang.String id)
ConfigCore.autoSessionsTracking is on, acquires device id.id - new user / device id string, cannot be emptyUsage logout()
ConfigCore.deviceIdStrategy and such). Obviously makes sense only after a call to login(String),
so it throws error or does nothing (depending on ConfigCore.testMode) if current id wasn't set using login(String).
Closes current session.java.lang.String getDeviceId()
Usage resetDeviceId(java.lang.String id)
Use changeDeviceIdWithoutMerge(String) or changeDeviceIdWithMerge(String)
Usage changeDeviceIdWithMerge(java.lang.String id)
id - new user / device id string, cannot be emptyUsage changeDeviceIdWithoutMerge(java.lang.String id)
id - new user / device id string, cannot be empty