public class ServerManager
extends java.lang.Object
implements android.arch.lifecycle.LifecycleObserver
ServerManager class collects all of the APIs related to server switch. This
includes processes such as changing and getting server url. All of these methods will be executed
on a background thread and return the result on the main thread. To receive the result, you are
expected to pass a corresponding CompleteCallback.| Constructor and Description |
|---|
ServerManager(android.support.v7.app.AppCompatActivity appCompatActivity)
Constructor for an
ServerManager object with the lifecycle set. |
ServerManager(android.support.v4.app.Fragment fragment)
Constructor for an
ServerManager object with the lifecycle set. |
ServerManager(android.arch.lifecycle.Lifecycle lifecycle)
Constructor for an
ServerManager object with the lifecycle set. |
| Modifier and Type | Method and Description |
|---|---|
void |
changeServerUrl(java.lang.String serverUrl,
CompleteCallback callback)
Returns a
CompleteCallback after changing server |
java.lang.String |
getServerUrl()
Returns a String that represents the server url the SDK is currently connected to
|
public ServerManager(android.arch.lifecycle.Lifecycle lifecycle)
ServerManager object with the lifecycle set.lifecycle - See Lifecyclepublic ServerManager(android.support.v7.app.AppCompatActivity appCompatActivity)
ServerManager object with the lifecycle set.appCompatActivity - See AppCompatActivitypublic ServerManager(android.support.v4.app.Fragment fragment)
ServerManager object with the lifecycle set.fragment - See Fragmentpublic void changeServerUrl(@Nonnull
java.lang.String serverUrl,
CompleteCallback callback)
CompleteCallback after changing serverserverUrl - the target server url to connect.callback - the callback to receive the result of changing serverpublic java.lang.String getServerUrl()