Forums/Community Help


How does Flurry Android SDK behave when application is placed in the background?

asked this on June 30, 2011, 16:18

Hi, i am implementing flurry for an Android app, does flurry SDK pause or end the session when the app goes to background or is it still continuing the session so the time spent on the background affects the session length, If it does not pause/stop the session when going background, is there a way to implement it so we can pause/stop it when going background and continue/start when it becomes active.


For Android, the Flurry session goes into a wait-and-see mode when the app goes into the background.

If the app becomes active within a window of time (default of 15 seconds), the session will continue. Otherwise, the session is considered ended at the time it went into the background.

Currently, there is no way at this time to pause the session and resume it programmatically.



User photo
Samo Jurdik


same question here.  Does it work the way on iOS?  Can we change the 15 second interval to a different value?

Thanks a lot.


January 6, 2012, 07:09
User photo
German Larrosa

Hi, so if an user spends more than 15 seconds on background mode the session is killed by Flurry automatically, that´s great. 

But in this scenario, what happens when the user comes back from background ? is a new session started automatically too by Flurry sdk?



June 15, 2012, 12:26
User photo
Yaron Muzikant

I guess you can use the Activity onPause and onResume to start/end the session. this should handle the case when the app goes to background and back.

June 27, 2012, 07:00
User photo
Flurry, Inc.

A session in Flurry is defined as one use of the app by the user. i.e if the user opens the app uses it for sometime and closes the app, it is defined as one session.


In an iOS app using Flurry, if the app pauses or moves to the background for more than 10 seconds, the next time the app runs, Flurry agent will automatically create a new session and end the previous session. Otherwise, Flurry agent will continue the same session. This can be updated via the setSessionContinueSeconds method. If the app is terminated, a new session will be created when the app runs again.

In case of Android, so long as there is any Context that has called onStartSession but not onEndSession, the session will be continued. Also, if a new Context calls onStartSession within 10 seconds of the last Context calling onEndSession, then the session will be resumed, instead of a new session being created.

If you wish to change the window during which a session can be resumed, call FlurryAgent.setContinueSessionMillis(long milliseconds) before the first call to FlurryAgent.onStartSession.

November 2, 2012, 07:17
User photo
Ankit Goyal

If i call startSession with new contex without calling endSession on last context, what will happened? is it considered as new session or same session will be continued?

Reason for asking this question is Flurry implementation guide suggests to call startSession in onStart and endSession  in onstop method but android framework says if user is moving from Activity1 to Activity2 method sequence will be following:-

  1. onPause of Activity1
  2. onCreate/onStart/onResume of Activity2
  3. onStop of Activity1

hence in this case if flurry treat it as new session then we should call endSession in onPause method only.

November 4, 2012, 06:46
Topic is closed for comments