public final class TMD
extends java.lang.Object
init(Context, TmdConfig)
as soon as possible in your Application
subclass Application.onCreate()
method.Modifier and Type | Method and Description |
---|---|
java.lang.String |
getInstallationId()
Retrieve the unique application installation id of application using the SDK
|
static TMD |
getInstance() |
android.app.PendingIntent |
getStartCallbackIntent() |
java.lang.String |
getUUID(android.content.Context context) |
void |
init(android.content.Context applicationContext,
TmdConfig tmdConfig)
Initialize Moprim TMD for a given Application.
|
boolean |
isConfigured(android.content.Context context)
Returns true if the TMD was able to receive the configuration from the Cloud
|
boolean |
isInitialized() |
static boolean |
isTmdRunning(android.content.Context context) |
void |
setStartCallbackIntent(android.app.PendingIntent intent)
Sets an callback intent for the background start of the TMD.
|
void |
setUUID(android.content.Context context,
java.lang.String uuid,
OnSetUUIDListener listener)
Set an unique user id to gather data from multiple installations.
|
static TmdStartReturnCode |
startForeground(android.content.Context context,
int id,
android.app.Notification notification)
Starts the TMD service for the given context
|
static void |
stop(android.content.Context context)
Stops the TMD service
|
boolean |
testInit(android.content.Context applicationContext,
TmdConfig coreConfiguration) |
static boolean |
wasTmdStarted(android.content.Context context) |
public static TMD getInstance()
public void setStartCallbackIntent(android.app.PendingIntent intent)
intent
- the intent to be executedpublic android.app.PendingIntent getStartCallbackIntent()
public void init(@NonNull android.content.Context applicationContext, TmdConfig tmdConfig)
Initialize Moprim TMD for a given Application.
The call to this method should be placed as soon as possible in the Application.onCreate()
method.
applicationContext
- Your Application context.java.lang.IllegalStateException
- if it is called more than once.public boolean testInit(@NonNull android.content.Context applicationContext, TmdConfig coreConfiguration)
public static TmdStartReturnCode startForeground(@NonNull android.content.Context context, int id, android.app.Notification notification)
context
- the given contextpublic static void stop(@NonNull android.content.Context context)
context
- the context to stop the tmd servicepublic static boolean isTmdRunning(@NonNull android.content.Context context)
context
- the contextpublic static boolean wasTmdStarted(@NonNull android.content.Context context)
context
- the context@WorkerThread public java.lang.String getInstallationId()
public java.lang.String getUUID(@NonNull android.content.Context context)
public void setUUID(@NonNull android.content.Context context, java.lang.String uuid, OnSetUUIDListener listener)
context
- the context of the applicationuuid
- the uuidlistener
- Listener to see if the UUID can be set for this installationpublic boolean isInitialized()
public boolean isConfigured(@NonNull android.content.Context context)