|
|||||||||
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 |
getAuthorUsername()
Get current app's author (i.e. |
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 and register a callback listener. |
static void |
install(Application app,
DeployGateCallback callback,
boolean forceApplyOnReleaseBuild)
Install DeployGate on your application instance and register a callback listener. |
static void |
install(Application app,
java.lang.String author)
Install DeployGate on your application instance. |
static void |
install(Application app,
java.lang.String author,
DeployGateCallback callback)
Install DeployGate on your application instance and register a callback listener. |
static void |
install(Application app,
java.lang.String author,
DeployGateCallback callback,
boolean forceApplyOnReleaseBuild)
Install DeployGate on your application instance and register a callback listener. |
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()
once.
On a release build, which has android:isDebuggable set false on
AndroidManifest.xml, this function will do nothing. If you want to enable
DeployGate on a release build, consider using
install(Application, String, DeployGateCallback, boolean)
instead.
Note: To make isAuthorized()
more effective, you should
call install(Application, String)
instead and specify authorId
explicitly to ensure the authority of this app to prevent casual
redistribution via DeployGate.
app
- Application instance, typically just pass this.
java.lang.IllegalStateException
- if this called twicepublic static void install(Application app, java.lang.String author)
Application#onCreate()
once.
On a release build, which has android:isDebuggable set false on
AndroidManifest.xml, this function will do nothing. If you want to enable
DeployGate on a release build, consider using
#install(Application, String[], DeployGateCallback, boolean)
instead.
app
- Application instance, typically just pass this.author
- author username of this app.
java.lang.IllegalStateException
- if this called twicepublic static void install(Application app, DeployGateCallback callback)
Application#onCreate()
once.
On a release build, which has android:isDebuggable set false on
AndroidManifest.xml, this function will do nothing. If you want to enable
DeployGate on a release build, consider using
install(Application, String, DeployGateCallback, boolean)
instead.
Note: To make isAuthorized()
more effective, you should
call install(Application, String)
instead and specify authorId
explicitly to ensure the authority of this app to prevent casual
redistribution via DeployGate.
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, java.lang.String author, DeployGateCallback callback)
Application#onCreate()
once.
On a release build, which has android:isDebuggable set false on
AndroidManifest.xml, this function will do nothing. If you want to enable
DeployGate on a release build, consider using
install(Application, String, DeployGateCallback, boolean)
instead.
app
- Application instance, typically just pass this.author
- author username of this app.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.
Note: To make isAuthorized()
more effective, you should
call install(Application, String)
instead and specify authorId
explicitly to ensure the authority of this app to prevent casual
redistribution via DeployGate.
app
- Application instance, typically just pass this.callback
- Callback interface to listen events. Can be null.forceApplyOnReleaseBuild
- if you want to keep DeployGate alive on
the release build, set this true.
java.lang.IllegalStateException
- if this called twicepublic static void install(Application app, java.lang.String author, DeployGateCallback callback, boolean forceApplyOnReleaseBuild)
Application#onCreate()
once.
app
- Application instance, typically just pass this.author
- author username of this app. Can be null.callback
- Callback interface to listen events. Can be null.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()
isAuthorized()
is true.
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 getAuthorUsername()
Tip: If you want to prevent distributing your app by someone else
on the DeployGate, consider using install(Application, String)
.
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 |