Integrating Flurry analytics

Find out how easy it is to integrate Flurry analytics into your app.

It doesn't take long to integrate Flurry analytics into your BlackBerry 10 app. Start by creating an account with Flurry, if you don't have one already. You can use your own app or get a sample app to work with. When you're done, run the app on a device or on a BlackBerry 10 Device Simulator. To see more activity for the app, ask some friends to run it as well. Then, log in to your Flurry account to see the information that's collected for the app.

These steps will get you started collecting basic app data. For more information, visit Flurry's Getting Started with BlackBerry documentation and see the API reference.

Get started with Flurry

  1. Sign up if you don't have an account.

  2. Click Add a new application and click the BlackBerry logo.

  3. Complete the app name and category information and click Create App.

  4. Make note of the unique application key, you'll need it soon.

  5. Click Download to get the Flurry SDK for BlackBerry. Save and extract the .zip file to your hard drive.

Add the Flurry SDK folder to your classpath

  1. Right-click Computer and choose Properties.

  2. Click Advanced system settings.

  3. Click Environment Variables.

  4. Select CLASSPATH and click Edit.

  5. Add the Flurry folder to the end of the variable value. Use a semi-colon to separate it from the previous item. For example, add ; C:\Flurry.

  6. Click OK to close the Classpath dialog, and again to close the Environment variables dialog.

Set up your project

For these next few steps, you can use your own app, one of the sample app projects installed with the Momentics IDE, or you can get the Flurry analytics sample app from github.

Find out how to Import an existing project.

Add the Flurry library

  1. In the Momentics IDE, right-click the project, select Configure > Add Library > External Library, and click Next.

  2. For Device library, click Browse and add armlev7/libFlurry.a.

  3. For Simulator library, click Browse and add x86/libFlurry.a

  4. For Include folders, click Add and find the folder with Flurry header files.

These files and folders don't need to be part of the project, but they do need to be in a directory path with no spaces.

Update your bar-descriptor.xml

  1. In your project, double-click the bar-descriptor.xml file to open it in the editor.

  2. On the Application tab, enable the read_device_identifying_information permission.

  3. On the Source tab, change instances of libFlurry.so to libFlurry.a.

Add a little code

  1. In your app's .PRO file, add the following line: LIBS += -lscreen -lcrypto -lcurl -lpackageinfo -lbbdevice. Now it should look something like this:

    APP_NAME = FlurryAnalyticsSample 
                        
    CONFIG += qt warn_on cascades10 
    LIBS += -lscreen -lcrypto -lcurl -lpackageinfo -lbbdevice  
                        
    include(config.pri)
  2. In your app's main.cpp file add #include Flurry.h then start the session using the application key that you received when you added the app to your Flurry account.
    #include <Flurry.h>
    
        //Set our session API Key (replace this value with your own key)
        Flurry::Analytics::StartSession("API Key")Íž 
    For "API Key", add the unique identifier that you received when you added your app to your Flurry account.

After you finish setting up your project, your app is ready to run. Click the Run button to launch the application on your device or simulator.

Last modified: 2013-12-21

comments powered by Disqus