|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.deploygate.sdk.DeployGate
public class DeployGate
This is DeployGate SDK library. Import this library to the application
package and call install(Application)
on the onCreate() of
application class to enable crash reporting and application launch
notification.
In order to get working Remote LogCat feature, you also have to add
<uses-permission android:name="android.permission.READ_LOGS" />
in AndroidManifest.xml of your application.
Method Summary | |
---|---|
static java.lang.String |
getLoginUsername()
Get current DeployGate username. |
static void |
install(Application app)
Install DeployGate on your application instance. |
static void |
install(Application app,
DeployGateCallback callback)
Install DeployGate on your application instance. |
static void |
install(Application app,
DeployGateCallback callback,
boolean forceApplyOnReleaseBuild)
Install DeployGate on your application instance. |
static boolean |
isAuthorized()
Get whether current DeployGate user has this application in his/her available list. |
static boolean |
isDeployGateAvaliable()
Get whether DeployGate client service is available on this device. |
static boolean |
isInitialized()
Get whether SDK is completed its intialization process and ready after install(Application) . |
static boolean |
isManaged()
Get whether this application and its package is known and managed under the DeployGate. |
static void |
logDebug(java.lang.String message)
Record DEBUG level event on DeployGate. |
static void |
logError(java.lang.String message)
Record ERROR level event on DeployGate. |
static void |
logInfo(java.lang.String message)
Record INFO level event on DeployGate. |
static void |
logVerbose(java.lang.String message)
Record VERBOSE level event on DeployGate. |
static void |
logWarn(java.lang.String message)
Record WARN level event on DeployGate. |
static void |
refresh()
Request refreshing cached session values (e.g., isAuthorized, etc.) to the DeployGate service. |
static void |
registerCallback(DeployGateCallback listener,
boolean refreshImmediately)
Register a DeployGate event callback listener. |
static void |
unregisterCallback(DeployGateCallback listener)
Unregister a callback listener. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void install(Application app)
Application#onCreate()
.
app
- Application instance, typically just pass this.public static void install(Application app, DeployGateCallback callback)
Application#onCreate()
once. On release build, which has
android:isDebuggable set false on AndroidManifest.xml, this
function will do nothing.
app
- Application instance, typically just pass this.callback
- Callback interface to listen events.
java.lang.IllegalStateException
- if this called twicepublic static void install(Application app, DeployGateCallback callback, boolean forceApplyOnReleaseBuild)
Application#onCreate()
once.
app
- Application instance, typically just pass this.callback
- Callback interface to listen events.forceApplyOnReleaseBuild
- if you want to keep DeployGate alive on
the release build, set this true.
java.lang.IllegalStateException
- if this called twicepublic static void refresh()
install(Application)
or when refreshing is already in progress.
Note that after calling this, isInitialized()
will changed to
false immediately and any call to is*() will be blocked until
refreshing get finished.
public static void registerCallback(DeployGateCallback listener, boolean refreshImmediately)
unregisterCallback(DeployGateCallback)
when the callback is no
longer needed (e.g., on destroying an activity.) If the listener has
already in the callback list, just ignored.
listener
- callback listenerrefreshImmediately
- if you want to receive current states, set this
true.public static void unregisterCallback(DeployGateCallback listener)
listener
- callback listener to be removedpublic static boolean isInitialized()
install(Application)
. This call will never blocked.
public static boolean isDeployGateAvaliable()
Note this function will block until SDK get ready after
install(Application)
called. So if you want to call this
function from the main thread, you should confirm that
isInitialized()
is true before calling this. (Or consider using
DeployGateCallback.onInitialized(boolean)
callback.)
public static boolean isManaged()
Note this function will block until SDK get ready after
install(Application)
called. So if you want to call this
function from the main thread, you should confirm that
isInitialized()
is true before calling this. (Or consider using
DeployGateCallback.onInitialized(boolean)
callback.)
public static boolean isAuthorized()
Note this function will block until SDK get ready after
install(Application)
called. So if you want to call this
function from the main thread, you should confirm that
isInitialized()
is true before calling this. (Or consider using
DeployGateCallback.onInitialized(boolean)
callback.)
public static java.lang.String getLoginUsername()
Note this function will block until SDK get ready after
install(Application)
called. So if you want to call this
function from the main thread, you should confirm that
isInitialized()
is true before calling this. (Or consider using
DeployGateCallback.onInitialized(boolean)
callback.)
public static void logError(java.lang.String message)
isAuthorized()
is not true.
message
- Message body to be send. May be truncated if it's too
long.public static void logWarn(java.lang.String message)
isAuthorized()
is not true.
message
- Message body to be send. May be truncated if it's too
long.public static void logDebug(java.lang.String message)
isAuthorized()
is not true.
message
- Message body to be send. May be truncated if it's too
long.public static void logInfo(java.lang.String message)
isAuthorized()
is not true.
message
- Message body to be send. May be truncated if it's too
long.public static void logVerbose(java.lang.String message)
isAuthorized()
is not
true.
message
- Message body to be send. May be truncated if it's too
long.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |