28 Apr 2014

Flurry integration | Flurry analytics in android

Hello Friends,

Today i am going to post Flurry analytics integration with android application.

What is Flurry Analytics?

According to flurry website, Flurry Analytics can be defined as  "Flurry Analytics provides accurate, real time data to developers about how consumers/users use their mobile applications and games, as well as how applications are performing across different handsets.

Why do we need Flurry?

As I have already mention, you would like know every detail statistics of your app after it goes on market. All these details are recorded after you integrate in it your app using Flurry SDK. What you need to do is just register and add application. After that you can download the corresponding SDK (latest one). Then you can see each day how our costumer grows and how much time they have used your application. It is very useful tool for developers to know the market value of your application.

Steps to implement Flurry with Application : 
1) Sign up with flurry 
2) Create A New Application
     -Click on the Applications tab to set up a new  application.
     -Choose your platform


3) Obtain Application Key:

    3.1 Download the Flurry Android SDK

    -The archive should contain these files:
     1. FlurryAnalytics_x.y.z.jar : The library containing Flurry's analytic collection and reporting code
         (where x.y.x denotes the latest version of Flurry SDK).
     2. FlurryAds_x.y.z.jar: The optional library to incorporate Flurry's ads into your application (where x.y.x            denotes the latest version of Flurry SDK).
     3. ProjectApiKey.txt : This file contains the name of your project and your project's API key.
         Analytics-README.pdf : This PDF file contains instructions.



4) Add the FlurryAnalytics_x.y.z.jar to your classpath 

     -If you're using Eclipse, modify your Java Build Path, and choose Add External JAR.
     -If you're using the SDK tools directly, drop it into your libs folder and the ant task will pick it up.

5) Add calls to onStartSession and onEndSession 

The following three lines of the code need to be added to the each Activity of your application to accurately capture duration of users' interaction with the application.

        @Override
 protected void onStart()
 {
  super.onStart();

  FlurryAgent.onStartSession(this, "Your Flurry ID");
  FlurryAgent.logEvent("Dashboard Screen Visited");
 }

 @Override
 protected void onStop() 
 {
  super.onStop();
  FlurryAgent.onEndSession(this);
 }


6) Now the way to log event is as follows


FlurryAgent.onEvent("Started Application");

-To set multiple event at time

HashMap<String, String> parameters = new HashMap<String, String>();
     parameters.put("Final score", "testing score");
     parameters.put("Time taken", "testing taken");
     FlurryAgent.onEvent("testing game", parameters);



Permission:
<uses-permission android:name=”android.permission.INTERNET”> </uses-permission>
<uses-permission> android:name=”android.permission.ACCESS_COARSE_LOCATION”> </uses-permission>


Result of tracing application:




Reference link:


I will be happy if you will provide your feedback or follow this blog. Any suggestion and help will be appreciated.
Thank you :)

1 comment:

  1. Good guide. Thanks!!
    Do we need to create an object for FlurryAgent like
    FlurryAgent myFlurryAgent = new Something();

    ReplyDelete