Get Real-Time Location Tracking for your apps with Mappls InTouch SDK. Track a user's live location with our simplified InTouch SDK integration (for Android), highly customizable to your specific needs.
The InTouch SDK comes with a variety of events that enable better control and power over your tracking needs. Get ready made events to create,, Geo-Fences, Event Alerts, and Trails of telematics/ phone devices. Also get location benefits built for various applications including logistics, delivery tracking, employee tracking, and live location sharing.
To get started, explore the InTouch Demo App.
Already have an application? Give it a boost with the powerful features of InTouch. Learn how to Integrate the InTouch SDK
- Setup: Please contact [email protected] to get the Intouch SDK authorisation for your Client ID and Client Secret.
- Quick Start: Start with a ready-to-go app
- Integrate the SDK: Integrate the SDK into your app
- Dashboard: See all your devices' locations on Mappls InTouch Dashboard
- InTouch Telematics APIs: Use InTouch APIs to get the details of the devices.
We use your Client ID to identify your account details and assign all your user's devices under a single account.
To get your Outh2 Rest API Client ID and Client Secret please login to Mappls API Dashboard
Please contact [email protected] to get InTouch SDK access to your Client ID
After getting the access, you can start with the InTouchDemo app, or Integrate the InTouch SDK in your app.
This guide allows you to add live location tracking to an Android app. Android Studio is the recommended development environment for building an app with the Mappls InTouch SDK for Android.
Click here to download the InTouchDemo App Project. Open this project in Android Studio
- Add the publishable key to SetUpKeyFragment Fragment file.
- Run project on your device using simulator instance.
- Go through run-time permission flow (applicable for Android M and later).
Step 3. Check your location on the InTouch dashboard
- Start Android Studio.
- Create a new project as follows:
- If you see the Welcome to Android Studio dialog, choose Start a new Android Studio project, available under 'Quick Start' on the right of the dialog.
- Otherwise, click File in the Android Studio menu bar, click New-> New Project.
- Select the form factors you need for your app. If you're not sure what you need, just select Phone and Tablet.
- Select Add No Activity and click Next.
- Enter your app name, package name, project location, language and minimum API version as prompted. Click Next.
- Create a Basic Activity in the 'Add an activity to Mobile' dialog. Click Next.
- Enter the activity name, layout name and title as prompted. Click Finish.
Android Studio starts Gradle and builds your project. This may take a few seconds. For more information about creating a project in Android Studio, see the Android Studio documentation.
The next few sections contain the code samples that you need to add to your activity's java file as well as its xml layout file for creating an app with Mappls InTouch SDK for live tracking.
Follow these steps to add the SDK to your project –
- Create a new project in Android Studio
- Add Mappls repository in your project level
build.gradle
allprojects {
repositories {
maven {
url 'https://maven.mappls.com/repository/mappls/'
}
}
}
- Add below dependency in your app-level
build.gradle
implementation 'com.mappls.sdk:intouch-sdk:1.4.2'
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
Required Minimum sdk version
minSdkVersion 19
Initialization can be done either of the below mentioned method. Keep the same method accross your project.
MapplsAccountManager.getInstance().setAtlasClientId(key_ci);
MapplsAccountManager.getInstance().setAtlasClientSecret(key_cs);
MapplsAccountManager.getInstance().atlasClientId = key_ci;
MapplsAccountManager.getInstance().atlasClientSecret = key_cs;
Initialize the SDK without unique Id. Intouch SDK will create a unique Id for the device. On every new device Login , a new device will be created and the new device id will be returned.
// IAuthListener - returns authorization results in the forms of callbacks.
InTouch.initialize(<device name>, new IAuthListener() {
@Override
public void onSuccess(Long id) {
//write your code here
}
@Override
public void onError(String reason, String identifier, String description) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// errorDescription gives a message for a particular error.
}
});
InTouch.initialize(<device name>, object : IAuthListener {
override fun onSuccess() {
//write your code here
}
override fun onError(reason: String?, errorIdentifier: String?, errorDescription: String?) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// errorDescription gives a message for a particular error.
}
})
Initialize the SDK with your own Unique Id. It is recommended to use when you maintain the unique Id for your users. Now when ever this Unique Id is passed same device id will be returned in the response, even if the user s logs from different devices.
// IAuthListener - returns authorization results in the forms of callbacks.
InTouch.initialize(<device name>, <uniqueId>, <fcmToken>, new IAuthListener() {
@Override
public void onSuccess(Long id) {
//write your code here
}
@Override
public void onError(String reason, String identifier, String description) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// errorDescription gives a message for a particular error.
}
});
InTouch.initialize(<device name>, <uniqueId>, <fcmToken>, object : IAuthListener {
override fun onSuccess(Long entityId) {
//write your code here
}
override fun onError(reason: String?, errorIdentifier: String?, errorDescription: String?) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// errorDescription gives a message for a particular error.
}
})
On sucessful registration you will get the Id, use this Id in APIs to get the live location or to create trips against the user.
Track your app user's phone live location by using the below method.
InTouch.startTracking();
InTouch.startTracking
InTouch.stopTracking();
InTouch.stopTracking
For any queries and support, please contact:
Email us at [email protected]Support Need support? contact us!