class Mixpanel extends ServiceImpl implements EventTrackingService
| Modifier and Type | Class and Description |
|---|---|
protected class |
Mixpanel.MixpanelEvent
Data transfer object to send to Mixpanel
|
protected static interface |
Mixpanel.MixpanelService
Retrofit service
|
| Modifier and Type | Field and Description |
|---|---|
protected Mixpanel.MixpanelService |
mixpanelService |
private java.lang.String |
projectToken |
context, utils| Constructor and Description |
|---|
Mixpanel(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
protected Mixpanel.MixpanelService |
createService()
Lazy load instance of
Mixpanel.MixpanelService |
void |
enable(java.lang.String projectToken)
Enable this service.
|
protected java.lang.String |
eventObjToBase64(Mixpanel.MixpanelEvent event)
Convert MixpanelEvent to a base64 string (format expected by Mixpanel).
|
ServiceType |
getServiceType()
Returns on of
ServiceType that corresponds to this service. |
boolean |
isEnabled()
This service is enabled
|
void |
logEvent(android.content.Context context,
java.lang.String eventName)
Send the given event to the backing service.
|
protected java.lang.String |
toBase64(byte[] data)
Return given bytes as a BASE64 encoded string.
|
private java.lang.String projectToken
protected Mixpanel.MixpanelService mixpanelService
public void enable(java.lang.String projectToken)
public boolean isEnabled()
public ServiceType getServiceType()
ServiceType that corresponds to this service.getServiceType in interface ServiceServiceType.public void logEvent(android.content.Context context,
java.lang.String eventName)
logEvent in interface EventTrackingServicecontext - Context.eventName - Event to track. This will be sent to the service represented by this class.protected Mixpanel.MixpanelService createService()
Mixpanel.MixpanelServiceMixpanel.MixpanelService. Never null.protected java.lang.String eventObjToBase64(Mixpanel.MixpanelEvent event)
event - Event data to send.protected java.lang.String toBase64(byte[] data)
data - Data to encodedata