com.netmera.mobile
Class NetmeraEvent

java.lang.Object
  extended by com.netmera.mobile.NetmeraEvent

public class NetmeraEvent
extends java.lang.Object

NetmeraEvent is used to send custom events and app analytic events about app open/close and time in app to Netmera Analytics service.


Method Summary
static void clearUnSendedEvents()
          Deletes all events that can not be sent to Netmera for some reasons and waiting for sending.
static void onStart(android.app.Activity activity)
          Use for tracking activity start.
static void onStop(android.app.Activity activity)
          Use for tracking activity end.
static void sendCustomEvent(java.lang.String key)
          This method is used to send your custom events which can be used to specify to trigger push notifications or create segments to Netmera.
static void sendCustomEventWithData(java.lang.String key, org.json.JSONObject data)
          This method is used to send your custom events which can be used to specify to trigger push notifications or create segments to Netmera.
static void sendEvent(java.lang.String key, org.json.JSONObject value)
          This method is used to send events which can be used to specify to trigger push notifications or create segments to Netmera.
static void sendPushClickedEvent(android.content.Intent intent)
           
static void sendTestGroupEvent(android.app.Activity activity)
          This method is used to add the device to test group, this method must be called inside the activity which is opened through the invite testers mail of Netmera.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sendCustomEvent

public static void sendCustomEvent(java.lang.String key)
                            throws NetmeraException
This method is used to send your custom events which can be used to specify to trigger push notifications or create segments to Netmera.

Parameters:
key - Event name
Throws:
NetmeraException - if key is empty or null & if your Netmera account type does not allow sending custom events.

sendCustomEventWithData

public static void sendCustomEventWithData(java.lang.String key,
                                           org.json.JSONObject data)
                                    throws NetmeraException
This method is used to send your custom events which can be used to specify to trigger push notifications or create segments to Netmera.

Parameters:
key - Event name
data - Event data
Throws:
NetmeraException - if key is empty or null & if your Netmera account type does not allow sending custom events.

sendTestGroupEvent

public static void sendTestGroupEvent(android.app.Activity activity)
This method is used to add the device to test group, this method must be called inside the activity which is opened through the invite testers mail of Netmera. Invite testers mail can be sent through the settings page of Netmera application. If the application is started through the mail; device is added to test group, otherwise nothing happens.

Parameters:
activity - Current activity i.e. this

sendEvent

public static void sendEvent(java.lang.String key,
                             org.json.JSONObject value)
                      throws NetmeraException
This method is used to send events which can be used to specify to trigger push notifications or create segments to Netmera.

Parameters:
key - Event name
value - Event data
Throws:
NetmeraException - if key is empty, key can not be empty.

sendPushClickedEvent

public static void sendPushClickedEvent(android.content.Intent intent)

onStart

public static void onStart(android.app.Activity activity)
Use for tracking activity start. You should call this method from Activity.onStart()

Parameters:
activity - Current activity i.e. this

onStop

public static void onStop(android.app.Activity activity)
Use for tracking activity end. You should call this method from Activity.onStop()

Parameters:
activity - Current activity i.e. this

clearUnSendedEvents

public static void clearUnSendedEvents()
Deletes all events that can not be sent to Netmera for some reasons and waiting for sending. If you don't delete them, Netmera will try to send them again periodically.