public abstract class ModuleBase extends java.lang.Object implements Module
| Constructor and Description |
|---|
ModuleBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(InternalConfig config)
All initialization must be done in this method, not constructor.
|
boolean |
isActive()
A method to be used by module itself to determine if it was initialized by
Module.init(InternalConfig)
and haven't been stopped yet by Module.stop(CtxCore, boolean). |
void |
onActivityCreated(CtxCore ctx)
Activity is being created.
|
void |
onActivityDestroyed(CtxCore ctx)
Activity is being destroyed.
|
void |
onActivityPaused(CtxCore ctx)
Activity is being paused.
|
void |
onActivityResumed(CtxCore ctx)
Activity is being resumed.
|
void |
onActivitySaveInstanceState(CtxCore ctx)
Activity is saving state.
|
void |
onActivityStarted(CtxCore ctx)
Activity is being launched.
|
void |
onActivityStopped(CtxCore ctx)
Activity is being stopped.
|
void |
onConfigurationChanged(CtxCore ctx)
Called when
android.content.res.Configuration changes. |
void |
onContextAcquired(CtxCore ctx)
SDK got a first context.
|
void |
onDeviceId(CtxCore ctx,
ConfigCore.DID deviceId,
ConfigCore.DID oldDeviceId)
Device ID has been acquired from device id provider.
|
void |
onLimitedContextAcquired(CtxCore ctx)
SDK got a first context.
|
java.lang.Boolean |
onRequest(Request request)
This method is called only on owning module only if module marks request as owned (
Request.own(Class). |
void |
onRequestCompleted(Request request,
java.lang.String response,
int responseCode)
Called when the request is executed.
|
void |
onSessionBegan(Session session,
CtxCore ctx)
Session is started.
|
void |
onSessionEnded(Session session,
CtxCore ctx)
Session is ended.
|
void |
onUserChanged(CtxCore ctx,
org.json.JSONObject changes,
java.util.Set<java.lang.String> cohortsAdded,
java.util.Set<java.lang.String> cohortsRemoved)
User object has been changed.
|
void |
stop(CtxCore ctx,
boolean clear)
App user decided to opt out from analytics or developer changed important preferences.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFeaturepublic void init(InternalConfig config)
Modulepublic void onDeviceId(CtxCore ctx, ConfigCore.DID deviceId, ConfigCore.DID oldDeviceId)
ModuleonDeviceId in interface Modulectx - Ctx to run indeviceId - deviceId valid from now onoldDeviceId - deviceId valid previously if anypublic void stop(CtxCore ctx, boolean clear)
ModuleStorable files if clear is truepublic boolean isActive()
ModuleModule.init(InternalConfig)
and haven't been stopped yet by Module.stop(CtxCore, boolean).public void onContextAcquired(CtxCore ctx)
ModuleApplication#onCreate())onContextAcquired in interface Modulectx - CtxCore with application instancepublic void onLimitedContextAcquired(CtxCore ctx)
ModuleInternalConfig.limited mode,
that is from CountlyService or android.content.BroadcastReceiver.onLimitedContextAcquired in interface Modulectx - CtxCore with application context instancepublic void onActivityCreated(CtxCore ctx)
ModuleonActivityCreated in interface Modulectx - CtxCore with activity setpublic void onActivityStarted(CtxCore ctx)
ModuleonActivityStarted in interface Modulectx - CtxCore with activity setpublic void onActivityResumed(CtxCore ctx)
ModuleonActivityResumed in interface Modulectx - CtxCore with activity setpublic void onActivityPaused(CtxCore ctx)
ModuleonActivityPaused in interface Modulectx - CtxCore with activity setpublic void onActivityStopped(CtxCore ctx)
ModuleonActivityStopped in interface Modulectx - CtxCore with activity setpublic void onActivitySaveInstanceState(CtxCore ctx)
ModuleonActivitySaveInstanceState in interface Modulectx - CtxCore with activity setpublic void onActivityDestroyed(CtxCore ctx)
ModuleonActivityDestroyed in interface Modulectx - CtxCore with activity setpublic void onSessionBegan(Session session, CtxCore ctx)
ModuleonSessionBegan in interface Modulesession - session which beganpublic void onSessionEnded(Session session, CtxCore ctx)
ModuleonSessionEnded in interface Modulesession - session which endedpublic void onUserChanged(CtxCore ctx, org.json.JSONObject changes, java.util.Set<java.lang.String> cohortsAdded, java.util.Set<java.lang.String> cohortsRemoved)
ModuleonUserChanged in interface Modulechanges - object with all the changes going to be sent to the servercohortsAdded - set of cohorts this user has just been added tocohortsRemoved - set of cohorts this user has just been removed frompublic java.lang.Boolean onRequest(Request request)
ModuleRequest.own(Class).
Gives a module another chance to modify request before sending. Being run in CountlyService.public void onRequestCompleted(Request request, java.lang.String response, int responseCode)
ModuleonRequestCompleted in interface Modulepublic void onConfigurationChanged(CtxCore ctx)
Moduleandroid.content.res.Configuration changes.onConfigurationChanged in interface Modulectx - CtxCore with only context set