public interface Module
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
getFeature() |
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
init(InternalConfig)
and haven't been stopped yet by 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.
|
void init(InternalConfig config) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
config - Countly configuration object: can be stored locally if needed.java.lang.IllegalArgumentException - in case supplied InternalConfig is not consistent.java.lang.IllegalStateException - if some required for this module platform feature is not available on this platform.void stop(CtxCore ctx, boolean clear)
Storable files if clear is truectx - CtxCore to run inclear - true if module must clear it's data files, false otherwiseboolean isActive()
init(InternalConfig)
and haven't been stopped yet by stop(CtxCore, boolean).true if module is allowed to continue to run, false otherwisevoid onContextAcquired(CtxCore ctx)
Application#onCreate())ctx - CtxCore with application instancevoid onLimitedContextAcquired(CtxCore ctx)
InternalConfig.limited mode,
that is from CountlyService or android.content.BroadcastReceiver.ctx - CtxCore with application context instancevoid onDeviceId(CtxCore ctx, ConfigCore.DID deviceId, ConfigCore.DID oldDeviceId)
ctx - Ctx to run indeviceId - deviceId valid from now onoldDeviceId - deviceId valid previously if anyvoid onActivityCreated(CtxCore ctx)
ctx - CtxCore with activity setvoid onActivityStarted(CtxCore ctx)
ctx - CtxCore with activity setvoid onActivityResumed(CtxCore ctx)
ctx - CtxCore with activity setvoid onActivityPaused(CtxCore ctx)
ctx - CtxCore with activity setvoid onActivityStopped(CtxCore ctx)
ctx - CtxCore with activity setvoid onActivitySaveInstanceState(CtxCore ctx)
ctx - CtxCore with activity setvoid onActivityDestroyed(CtxCore ctx)
ctx - CtxCore with activity setvoid onSessionBegan(Session session, CtxCore ctx)
session - session which beganvoid onSessionEnded(Session session, CtxCore ctx)
session - session which endedvoid onUserChanged(CtxCore ctx, org.json.JSONObject changes, java.util.Set<java.lang.String> cohortsAdded, java.util.Set<java.lang.String> cohortsRemoved)
ctx - changes - 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 fromjava.lang.Boolean onRequest(Request request)
Request.own(Class).
Gives a module another chance to modify request before sending. Being run in CountlyService.request - request to checktrue if ok to send now, false if not ok to (remove request
from queue), null if cannot decide yetvoid onRequestCompleted(Request request, java.lang.String response, int responseCode)
void onConfigurationChanged(CtxCore ctx)
android.content.res.Configuration changes.ctx - CtxCore with only context setjava.lang.Integer getFeature()