I am trying to find information regarding whether device orientation in my application is skewing the analytics due to sessions log occurring during the activity life cycle.
Sessions in Flurry seem to begin and end with activity start and stop, and a device orientation effectively causes a new activity life cycle to begin, do I receive two sets of data for this?
If so, what is the correct way to handle device orientation so that when a user rotates the device I don’t receive skewed results?
A call to
onStartSessionwill only start a new session if a previous call toonEndSessionoccurred over ten seconds ago. (ten seconds is the default, seesetContinueSessionMillis)So if you call
onStartSessionfrom eachActivity.onStartandonEndSessionfrom eachActivity.onStopyour session data will not be inflated by changes in orientation, since those Activity lifecycle methods will be much quicker than ten seconds apart. Your session data won’t be inflated by users moving from FooActivity to BarActivity either, since those transitions are also shorter than ten seconds.Instead, if a user starts your app and goes from FooActivity to BarActivity, but then leaves your app, when they return BarActivity’s
onStartwill called along withFlurryAgent.onStartSession, and if they’ve been away for longer than ten seconds a new session will be started. This is usually what developers want to track.(disclaimer: I work on the Android SDK at Flurry)