public final class Mesosfer
extends java.lang.Object
Mesosfer
class contains static functions that handle global configuration
for the Mesosfer library.Modifier and Type | Field and Description |
---|---|
static int |
LOG_LEVEL_DEBUG |
static int |
LOG_LEVEL_ERROR |
static int |
LOG_LEVEL_INFO |
static int |
LOG_LEVEL_NONE |
static int |
LOG_LEVEL_VERBOSE |
static int |
LOG_LEVEL_WARNING |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getApplicationId()
Gets Mesosfer application id
|
java.lang.String |
getClientKey()
Gets Mesosfer client key
|
static Mesosfer |
getInstance()
Gets the instance of Mesosfer library
|
java.lang.String |
getVersionName()
Gets the current Mesosfer version library
|
static void |
initialize(android.content.Context appContext,
java.lang.String applicationId,
java.lang.String clientKey)
Authenticates this client as belonging to your application.
|
static boolean |
isInitialized()
Checks the initialization Mesosfer library state
|
static void |
setLogLevel(int logLevel)
Sets the level of logging to display, where each level includes all those below it.
|
static void |
setPushNotification(boolean isPushNotificationEnabled)
Sets the Mesosfer Push Notification service status
|
public static final int LOG_LEVEL_VERBOSE
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_WARNING
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_NONE
public static void initialize(android.content.Context appContext, java.lang.String applicationId, java.lang.String clientKey)
applicationId
This must be called before your
application can use the Mesosfer library. The recommended way is to put a call to
Mesosfer.initialize
in your Application
's onCreate
method:
public class MyApplication extends Application { public void onCreate() { Mesosfer.initialize(this, "your application id", "your client key"); } }
appContext
- The active Context
for your application.applicationId
- The application id provided in the Mesosfer cloud.clientKey
- The client key provided in the Mesosfer cloud.public static void setLogLevel(int logLevel)
LOG_LEVEL_NONE
. Please ensure this is set to LOG_LEVEL_ERROR
or LOG_LEVEL_NONE
before deploying your app to ensure no sensitive information is
logged. The levels are:
logLevel
- The level of logcat logging that Mesosfer should do.public static void setPushNotification(boolean isPushNotificationEnabled)
isPushNotificationEnabled
- true
to enable push notification, false
otherwisepublic static boolean isInitialized()
True
if initialize(android.content.Context, java.lang.String, java.lang.String)
has been called, otherwise false
.public static Mesosfer getInstance()
public java.lang.String getApplicationId()
public java.lang.String getClientKey()
public java.lang.String getVersionName()