Implementing the AIR SDK

To use the Bango AIR SDK you will have to import in your project both the library (BangoSDK.swc) and the Native Extensions.

The Native extensions provided are the following:

  • android.ane
  • blackberry.ane
  • iOS.ane

You can find all this files ready to use in the Binary folder.

No Native extension is needed for Desktop Applications.

 

 

Importing the Bango SDK File

If not existing is suggested to create a “libs” folder in your project and copy the files from the Binary folder in there.

To import the SDK file in your project right click on your project in the Package Explorer view of Flash Builder and click proprieties. Select Flex Build Path and then go to the Library Path tab.

Click the “Add SWC…” and browse to the BangoSDK.swc file you copied in your libs folder.

 

Importing the Native Extensions

Adobe AIR allows you app to be deployed to three types of operating systems: Android, iOS, Blackberry Playbook OS. This doesn’t mean you must deploy to all of them. Please follow the next procedure for each of the devices you want your app to be deployed to.

In your project right click on your project in the Package Explorer view of Flash Builder and click proprieties.

Select Flex Build Path and then go to the Native Extensions tab.

Click “Add ANE…”, browse to the libs folder and select the .ane file you want to add.

Expand Flex Build Packaging and select the operating system you want to activate.

Check the checkbox “Enable this target platform” and than select the Native extensions tab.

Make sure that only the Native extension related to the selected operating system is checked.

 

Using the SDK

There are 2 methods that must be called for the application analytics to perform correctly. There must be called after any of the configuration options have been set:

Insert a call to BangoAgent.startSession(String) when your application is initialized. It is suggested to do this with a listener on the creationComplete and Activate events of your application.

Insert a call to BangoAgent.endSession() when your application goes into the background. This can be achieved by adding a listener to the Deactivate  and Exit events.

Please note that the creationComplete event will be called only when the application is first created. If it is sent to the background and then invoked, only the Activate event will be called. Therefore you should add also a listener to this event.

To log events you can either use the generic method:

            BangoAgent.onEvent(eventName, eventValue, eventDetailmeventParams)

Or you can use one of the predefined methods to log a predefined event type:

            BangoAgent.onSearch(eventValue, eventDetailmeventParams);

            BangoAgent.onPageView(eventValue, eventDetailmeventParams);

Please see below for further information.

Last edited Jun 22, 2012 at 1:10 PM by BangoSimone, version 3

Comments

No comments yet.