-
Notifications
You must be signed in to change notification settings - Fork 2
Event's Data
katariadeepak86 edited this page Sep 29, 2020
·
12 revisions
Get the Trails (Travelled path) of a device in your account using the below methods.
InTouch.getLocationsEvents(<deviceId>,<startTime>,<endTime>,<skipPeriod> new ILocationEventsListener() {
@Override
public void onSuccess(LocationEventsResponse locationEventsResponse) {
// Write your code here.
}
@Override
public void onError(String s, String s1, String s2) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// error description gives a message for a particular error.
}
});
InTouch.getLocationsEvents(<deviceId>,<startTime>,<endTime>,<skipPeriod>, object: ILocationEventsListener{
override fun onSuccess(t: LocationEventsResponse?) {
// Write your code here.
}
override fun onError(reason: String?, errorIdentifier: String?, errorDescription: String?l̥l̥) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// error description gives a message for a particular error.
}
})
-
deviceId(Long)
- Id of the device for which the location data need to be fetched. -
startTime(Long)
- Start Epoch timestamp in seconds from which the events need to be fetched. -
endTime(Long)
- End Epoch timestamp in seconds till which the events need to be fetched. -
skipPeriod(int)
- Defined in minutes. For example, if 2 is passed then the returned data packet will have a minimum difference of 2 mins else 0.
- 200: To denote a successful API call.
- 400: Bad Request, User made an error while creating a valid request.
- 401: Unauthorized, the Developer’s key is not allowed to send a request with restricted parameters.
- 403: Forbidden, the Developer’s key has hit its daily/hourly limit.
- 500: Internal Server Error, the request caused an error in our systems.
- 503: Service Unavailable, during our maintenance break or server downtimes.
- 200: Success
- 203: Device Not Found
- 400: Bad Request - Invalid device ID supplied or invalid data type. For example, the input attribute "id" is an integer but string value gets passed.
- 401: Unauthorized Request. Access to API is forbidden.
- 404: Not Found - URL Not Found
LocationEventResponse
class object returns the API response as a JSON object.
-
deviceId (Long)
- Device id of selected device. -
drivingBehaviourCount (DrivingBehaviourCount)
- Driving behavior count in the selected device. -
summary (Summary)
- Brief summary of all locations. -
positionList (List<PositionList>)
- List of location positions.
-
distance (Double)
- Total drive distance in KM(s). -
duration (Long)
- Total drive duration in seconds. -
avgSpeed (Double)
- Average speed in km/hr. -
startAddress (String)
- Start address of the location. -
endAddress (String)
- End address of the location. -
startTimestamp (Long)
- Start Epoch time of the event. i,e) the time at which the data first came from the device for the selected day -
endTimestamp (Long)
- End Epoch time of the event. i,e) the time at which the last data came from the device for the selected day.
-
haCount (Integer)
- Harsh acceleration count. -
hbCount (Integer)
- Harsh braking count. -
hcCount (Integer)
- Harsh cornering count.
-
address (String)
- Address of particular location. -
timestamp (Long)
- Epoch Time at a particular location. -
longitude (Double)
- Location longitude. -
latitude (Double)
- Location latitude. -
heading (Double)
- Device heading direction in degrees from North. -
speed (Double)
- Device speed at this particular location. -
powerSupplyVoltage (Double)
- Battery voltage value in millivolts. -
ignition (Boolean)
- Whether vehicle ignition is On or Off. 0 means ignition is OFF and 1 means ignition is ON. -
gpsFix (Boolean)
- GPS fixes or not for the device. true means GPS is fixed and false means GPS is not fixed. -
validGPS (Boolean)
- Checks whether GPS is valid or not. -
accOff (Boolean)
- Checks for whether adaptive cruise control is enabled or not. -
movementStatus (String)
- Checks the movement status of the device. 1:Moving, 2:Idle, 3:Stopped, 4:Towing, 5:No Data 6:Power Off, 7:No Gps, 8:On Trip, 9:Free Vehicle -
mobileInfos (MobileInfo)
- MobileInfo object
-
locationSource (Integer)
- Returns location source i.e 1 - GPS connected, 2 - GPRS connected. -
mockLocation (Boolean)
- If true means mock location is enabled else false means real GPS location being sent by the user. -
isAirplanemode (Boolean)
- Checks whether mobile's airplane mode is ON or OFF. -
callStatus (Integer)
- Current call status like 0:CALL_STATE_IDLE, 1:CALL_STATE_RINGING, 2:CALL_STATE_ONCALL -
deviceStatus (Integer)
- Status of the device in the current location. 0: IN_VEHICLE, 1: ON_BICYCLE, 2: ON_FOOT, 3:STILL, 4:UNKNOWN, 5:TILTING, 6:WALKING, 7:RUNNING. -
phoneEvent (Integer)
- Checks the location permission that the user enables/disables in the mobile phone. For eg:- 5 for location permission denied. 6 for location provider off etc.