Call the createTimerEvent to start timing for an event. Configure the name of the event, and event properties to report. When the event comes to an end, a "_duration" property will automatically be added for this event (unit: millisecond). It should be noted that there can only be one timing task for the same event.
Function
ppublic synchronized TrackEvent createTimerEvent(String eventName, JSONObject eventData);
Parameter | Description | Type | Required |
---|---|---|---|
eventName | Developer custom event name | String | Yes |
customEventData | Developer custom event property | JSONObject | Yes |
Returned value: "trackEvent"
Sample Code
import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
JSONObject eventData = new JSONObject();
try {
//Custom event properties in JSON format.
eventData.put("key1","value1");
eventData.put("key2","value2");
......
} catch (JSONException e) {
///
}
TrackEvent trackEvent = SolarEngineManager.getInstance().createTimerEvent("xxxCustomEventNamexxx", eventData);
Function
public synchronized void trackTimerEvent(TrackEvent trackEvent);
Parameter | Description | Type | Required |
---|---|---|---|
trackEvent | Developer custom duration event name | TrackEvent | Yes |
Sample Code
import com.reyun.solar.engine.SolarEngineManager;
//The trackEvent here is obtained by creating duration event calling createTimerEvent method.
trackEventSolarEngineManager.getInstance().trackTimerEvent(trackEvent);
Note:
When reporting the preset event _appEnd, the duration starting from the last _appStart will be reported by default. That is, the duration of an exit event does not need to be configured to start timing, and will be assigned a value by default.