class FoamMain
extends java.lang.Object
FoamApplicationInit.
To add new services to foam, modify init(FoamApiKeys) to add your new service
to our services map, then modify initializeServices() to pass the
correct API key to the service. More details can be found in the README / wiki.| Modifier and Type | Field and Description |
|---|---|
private android.content.Context |
context |
(package private) CustomExceptionHandler |
customExceptionHandler |
(package private) EventTracker |
eventTracker |
(package private) FoamApiKeys |
foamApiKeys |
(package private) LogListener |
logListener |
(package private) java.util.Map<ServiceType,Service> |
services |
| Constructor and Description |
|---|
FoamMain(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
(package private) <T extends Service> |
getEnabledServicesForType(java.lang.Class<T> clazz)
Return Service classes defined in
services that match the given interface (one of
Service's child interfaces). |
protected void |
init(FoamApiKeys foamApiKeys)
Add all services to
services map, with an associated ServiceType enum. |
(package private) void |
initializeServices()
Loop through all services.
|
(package private) void |
logEvent(android.content.Context context,
java.lang.String event)
Used by
FoamEvent to log custom events. |
(package private) void |
start()
Start up Foam!
|
(package private) void |
startCustomExceptionHandler()
Start Foam custom exception handler class.
|
(package private) void |
startEventTracker()
Start Foam event tracker.
|
(package private) void |
startLogListener()
Start Foam log listener class.
|
(package private) void |
stop()
Disable foam
|
private android.content.Context context
FoamApiKeys foamApiKeys
java.util.Map<ServiceType,Service> services
EventTracker eventTracker
CustomExceptionHandler customExceptionHandler
LogListener logListener
protected void init(FoamApiKeys foamApiKeys)
services map, with an associated ServiceType enum.foamApiKeys - Instance of FoamApiKeys used to initialize foam services.void start()
void stop()
void initializeServices()
void startCustomExceptionHandler()
CustomExceptionHandlervoid startLogListener()
LogListenervoid startEventTracker()
EventTracker<T extends Service> java.util.List<T> getEnabledServicesForType(java.lang.Class<T> clazz)
services that match the given interface (one of
Service's child interfaces).T - Type for the option valueclazz - Interface (child of Service interface). The returned List
will be all Service's from our services map that can be cast to this
interface type.void logEvent(android.content.Context context,
java.lang.String event)
FoamEvent to log custom events.context - Contextevent - Event name to track.