Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems getting timed events in Flurry Analytics to work

I have already checked out this link and followed the instructions exactly: Can Flurry analytics provide average of integer information?

Have also read the instructions from Flurry, provided when downloading the SDK. I am putting in a "onStartSession()" and "onEndSession()" on every activity in my app and within these "session wrappers" I try to log a timed event, to keep track of how long the user used each activity.

The events get logged in Flurry Analytics, however there is no "Event duration" information available (the clock icon).

Here is my code:

public void onStart(){
   super.onStart();
   FlurryAgent.onStartSession(this, Flurry.FLURRY_KEY);
   FlurryAgent.logEvent(Flurry.ACTIVITY_RADAR, true); 
}


public void onStop() {
   super.onStop();
   FlurryAgent.endTimedEvent(Flurry.ACTIVITY_RADAR);
   FlurryAgent.onEndSession(this);
}

Would appreciate some help on this annoying problem! /Martin

like image 478
marhol682 Avatar asked Oct 05 '11 10:10

marhol682


1 Answers

I had the same issue and after bashing my head against the wall for a while I just implemented my own timer. I even emailed Flurry to ask them what was going on, but no response. I even mentioned in the email how their events according to their API would start a session before ending the last session due to Androids Activity lifecycles (the onStop of the current activity CAN be called AFTER the onStart of the next activity).

In my solution I have a general timer class that starts timing according to a string and when the endTimer is called for that string it returns a time in seconds according to timestamps. Then when I call flurry I just add a hashmap with that parameter. It isn't a great fix, but couldn't find anything else that worked.

like image 67
MikeIsrael Avatar answered Sep 28 '22 02:09

MikeIsrael