The most important functionality is implemented within 2 methods. These methods must be called after any of the configuration options have been set, such as setting the post url (BangoAgent::setPostURL(url)). These methods are:

1. BangoAgent::onStartSession(applicationId), passing a reference to your Application ID you created in Step 1. We recommend making a call to this method in the entry point of your app; i.e. the main method, and anywhere else you wish to log the user starting a session. The method onStart() below is called from the main method in the Sample Implementation app.
void BangoBlackberry10App::onStart()
{
if(!loadQMLScene()){
qWarning("Failed to load QML Scene");
}


BangoAgent::setPostURL("http://dev.bango.org/appanalytics/debug/");
//this is the application ID that would be set in management tools

BangoAgent::onStartSession("111888533");
}


2. BangoAgent::onEndSession(), call this method when a session is complete, for example on your App’s exit.
Once an event has occurred, it can be posted straight away to the Bango Server by making a call to BangoAgent::postEvents(), or it can be stored on the mobile device’s memory to be sent at a later time.
Bango uses the concept of batches and events. You can send one batch with each transmission and each batch may contain many events. This model stores events on the mobile device’s memory ready for sending as a batch when the application calls the onEndSession, or PostEvents method. This means that the sending of event data does not create any network traffic when the application is in use. This model is less network-intensive because data common to each event is only sent once with each batch.

Last edited May 21, 2013 at 4:10 PM by BangoSonya, version 1

Comments

No comments yet.