public final class

TMD

extends Object
java.lang.Object
   ↳ fi.moprim.tmd.sdk.TMD

Class Overview

Use this class to initialize the TMD init(Application, TmdCoreConfiguration, TmdInitListener) as soon as possible in your Application subclass onCreate() method.

Summary

Public Constructors
TMD()
Public Methods
static String getInstallationId()
Retrieve the unique application installation id of application using the SDK
static TmdCoreConfiguration getTmdCoreConfiguration()
Get the core configuration parameters currently used by the TMD
static String getUUID()
static void init(Application app, TmdCoreConfiguration coreConfiguration)

Initialize Moprim TMD for a given Application.

static void init(Application app, TmdCoreConfiguration coreConfiguration, TmdInitListener tmdInitListener)

Initialize Moprim TMD for a given Application.

static boolean isInitialized()
static boolean isTmdRunning(Context context)
Depracted use isTmdRunning()} instead
static boolean isTmdRunning()
static void setUUID(String uuid)
Set an unique user id to gather data from multiple installations.
static void startForeground(Context context, int id, Notification notification)
Starts the TMD service for the given context
static void stop(Context context)
Stops the TMD service
static void updateDataCleaningInterval(int days)
Updates tha interval in days when the data must be cleaned
static void updateDataSyncInterval(int intervalMinutes)
Update the interval to sync data to the cloud
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TMD ()

Public Methods

public static String getInstallationId ()

Retrieve the unique application installation id of application using the SDK

Returns
  • the unique installation id

public static TmdCoreConfiguration getTmdCoreConfiguration ()

Get the core configuration parameters currently used by the TMD

Returns
  • the core configuration used by the TMD

public static String getUUID ()

public static void init (Application app, TmdCoreConfiguration coreConfiguration)

Initialize Moprim TMD for a given Application.

The call to this method should be placed as soon as possible in the attachBaseContext(Context) method.

Parameters
app Your Application class.
Throws
IllegalStateException if it is called more than once.

public static void init (Application app, TmdCoreConfiguration coreConfiguration, TmdInitListener tmdInitListener)

Initialize Moprim TMD for a given Application.

The call to this method should be placed as soon as possible in the attachBaseContext(Context) method.

Parameters
app Your Application class.
tmdInitListener a listener for the state of the initialisation
Throws
IllegalStateException if it is called more than once.

public static boolean isInitialized ()

Returns
  • true if the TMD has been properly initialized

public static boolean isTmdRunning (Context context)

Depracted use isTmdRunning()} instead

Parameters
context the context
Returns
  • true if the TMD service for this app is already running

public static boolean isTmdRunning ()

public static void setUUID (String uuid)

Set an unique user id to gather data from multiple installations.

Parameters
uuid the unique user id

public static void startForeground (Context context, int id, Notification notification)

Starts the TMD service for the given context

Parameters
context the given context

public static void stop (Context context)

Stops the TMD service

Parameters
context the context to stop the tmd service

public static void updateDataCleaningInterval (int days)

Updates tha interval in days when the data must be cleaned

Parameters
days the interval in days, if -1. it cancel the cleaning.

public static void updateDataSyncInterval (int intervalMinutes)

Update the interval to sync data to the cloud

Parameters
intervalMinutes the interval in minutes, cannot be less than 15 or throw IllegalArgumentException