Interface AppContextService
-
- All Implemented Interfaces:
public interface AppContextService
-
-
Method Summary
Modifier and Type Method Description abstract voidsetApplication(@NonNull() Application application)Set the Android Application, which enables the SDK get the app Context, register a Application.ActivityLifecycleCallbacks to monitor the lifecycle of the app and get the android.app.Activity on top of the screen.abstract ApplicationgetApplication()Get the global Application object of the current process. abstract ActivitygetCurrentActivity()Returns the current Activityabstract ContextgetApplicationContext()Returns the application Contextabstract AppStategetAppState()Get the current application state. abstract ConnectivityManagergetConnectivityManager()Get the instance of ConnectivityManager -
-
Method Detail
-
setApplication
abstract void setApplication(@NonNull() Application application)
Set the Android Application, which enables the SDK get the app
Context, register a Application.ActivityLifecycleCallbacks to monitor the lifecycle of the app and get the android.app.Activity on top of the screen.NOTE: This method should be called right after the app starts, so it gives the SDK all the contexts it needed.
- Parameters:
application- the Android Application instance.
-
getApplication
@Nullable() abstract Application getApplication()
Get the global Application object of the current process.
NOTE: setApplication must be called before calling this method.
- Returns:
the current
Application, or null if noApplicationwas set or theApplicationprocess was destroyed.
-
getCurrentActivity
@Nullable() abstract Activity getCurrentActivity()
Returns the current
Activity- Returns:
the current
Activity
-
getApplicationContext
@Nullable() abstract Context getApplicationContext()
Returns the application
Context- Returns:
the application
Context
-
getAppState
@NonNull() abstract AppState getAppState()
Get the current application state.
- Returns:
AppState the current application state
-
getConnectivityManager
@Nullable() abstract ConnectivityManager getConnectivityManager()
Get the instance of ConnectivityManager
- Returns:
the instance of ConnectivityManager
-
-
-
-