/android-sdk

TrackMe server Android API

Primary LanguageJava

android-api

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>lk.trackme</groupId>
    <artifactId>android-api</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "lk.trackme:android-api:1.0.0"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/android-api-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import lk.trackme.client.api.DevicesApi;

public class DevicesApiExample {

    public static void main(String[] args) {
        DevicesApi apiInstance = new DevicesApi();
        Long id = 789L; // Long | identifier of device to be deleted
        String uniqueId = "uniqueId_example"; // String | IMEI of device to be deleted
        try {
            apiInstance.deviceDelete(id, uniqueId);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevicesApi#deviceDelete");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://trackme.lk/api/v1

Class Method HTTP request Description
DevicesApi deviceDelete DELETE /devices
DevicesApi devicePost POST /devices
DevicesApi devicePut PUT /devices
DevicesApi deviceShare POST /devices/{deviceId}/share
DevicesApi deviceStopSharing DELETE /devices/{deviceId}/share
DevicesApi devicesGet GET /devices
LoginApi usersPost POST /login
PositionsApi devicePositionsGet GET /positions/{deviceId}
PositionsApi historyPositionsGet GET /positions/history/{deviceId}
PositionsApi positionsGet GET /positions
Recover_passwordApi recoveryPassword POST /recover_password
Recover_passwordApi usersPut PUT /recover_password
UsersApi getCurrentUser GET /users/me
UsersApi registerNewUser POST /users
UsersApi updateCurrentUser PUT /users/me

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

TrackMe-Api-Key

  • Type: API key
  • API key parameter name: TrackMe-Api-Key
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author