Search code examples
androidflurry

Starting and closing Flurry session


I have been watching some other questions in here, but I don't really understand some reasons.

I have an app with a lot of activies, and a Flurry analytics API key. I want a flurry session to be a whole session, while people recommend to start and stop sessions in each activity. However, that would result in a 50 flurry session/ real session.

I put the onStartSession() method on a login activity, and the onStop when logging out. And I'm having some troubles with events logged, looks like it is skipping them.

Any idea on this?


Solution

  • You can make calls to start session and end session for each activity in your app. Please note that a call to end session must match up with each call of start session. If a call to start session is made within 10 seconds of previous end session call, the session will be resumed. Session length, usage frequency, events and errors will continue to be tracked as part of the same session. This ensures that as a user transitions from one Activity to another in your application that they will not have a separate session tracked for each Activity, but will have a single session that spans many activities. You may change the default value of 10 seconds using the call FlurryAgent.setContinueSessionMillis(long milliseconds). Please note that a minimum timeout is 5 seconds in case of Android.

    (Full disclosure: I work at Flurry)