T
T
Teliver
Search…
Customization
Now, let’s see the other functionalities that could be performed.
  • Configuring Location updates
    What if you want to set your own way of getting the location updates from the operator?
1
TripBuilder builder = new TripBuilder("Tracking_Id");
2
builder.withInterval(5000); //Location update set to 5 seconds.
3
builder.withDistance(10); //Location update set to 10 meters.
4
Teliver.startTrip(builder.build());
Copied!
You can also customize more with the method builder.withLocationRequest(locationrequest) Where you can pass the object of LocationRequest class of playservice.
  • Listeners for Trip
    You can add listeners for the trips that you started by simply calling the below snippet.
1
Teliver.setTripListener(new TripListener() {
2
@Override
3
public void onTripStarted(Trip tripDetails) {
4
//This method is called when a trip has been started.
5
}
6
7
@Override
8
public void onLocationUpdate(Location location) {
9
//This method is called when an location update is made.
10
11
}
12
13
@Override
14
public void onTripEnded(String trackingID) {
15
//This method is called when a trip has been Ended.
16
17
}
18
19
@Override
20
public void onTripError(String reason) {
21
//This method is called when a trip has faced error on starting.
22
23
}
24
});
Copied!
  • Custom marker options
    What if you want to set your own image, title and snippet for marker?
1
MarkerOption option = new MarkerOption("Tracking_Id");
2
option.setMarkerTitle("Your_Title");
3
option.setMarkerSnippet("Your_Snippet");
4
option.setIconMarker(R.drawable.your_drawable); //You can also set your Bitmap object.
5
6
Teliver.startTracking(new TrackingBuilder(option).withTitle("Track").build());
Copied!
Note: withTitle() method here sets your page title on tracking page
  • Multiple Operator Tracking
    What if you want to track multiple operators?
1
List<MarkerOption> markerOptionList = new ArrayList<>();
2
String[] ids = {"operator_1","operator_2","operator_3"};
3
for(String id:ids){
4
MarkerOption option=new MarkerOption(id);
5
markerOptionList.add(option);
6
}
7
8
Teliver.startTracking(new TrackingBuilder(markerOptionList).build());
Copied!
Note: Multiple Operator Tracking allowed only on paid plans
  • Tracking on your map
    What if you want tracking to happen on your own view rather than ours?
1
Teliver.startTracking(new TrackingBuilder(option).withYourMap(googleMap).build());
Copied!
This snippet enables the entire tracking system in order to take place in your own map object. Just pass the object created and you are done.
  • Get Location updates
    What if you want just the location updates of each operator?
1
Teliver.startTracking(new TrackingBuilder(option).withListener(new TrackingListener(){
2
@Override
3
public void onTrackingStarted(String trackingId) {
4
//This method is called when the operator initiates the trip by startTrip method.
5
}
6
7
@Override
8
public void onLocationUpdate(String trackingId, TLocation location) {
9
//This method is called when there is a updates in the location.
10
}
11
12
@Override
13
public void onTrackingEnded(String trackingId) {
14
//This method is called when tracking has stopped by calling the method stopTracking.
15
}
16
17
@Override
18
public void onTrackingError(String reason) {
19
//This method is called when there is error on tracking.
20
}
21
})).build());
Copied!
  • Tag Location
    What if you want to tag a particular location for future reference?
From your Operator app use the following snippet to tag a location of Operator.
1
Teliver.tagLocation("Tracking_Id", "your order is delivered");
Copied!
On your dashboard under Record of Trips you can find the tagged location as like below.
Copy link