Flurry Configuration

Over the last few months, I noticed that one of my apps, was searching for GPS long after the app was closed. I noticed that it usually happened in low-GPS areas and seemed intermittent.

After looking into the usual culprits – not calling myLocationOverlay.disableMyLocation()  or not calling locationManager.removeUpdates() in onPause(), I discovered a new problem I hadn’t seen/heard of before.

After some forensic debugging, I found this line of code:

FlurryAgent.onStartSession(this, "<Flurry API Key>");

I thought, there’s no way that Flurry is requesting location and not giving it up when the app is backgrounded, right?


After some digging in the API docs, I found:

static void setReportLocation (boolean reportLocation)

Set whether Flurry should include location information within its reports. Defaults to true.

Calling setReportLocation(false) fixed the leaking GPS issue (since I don’t care about location analytics on Flurry anyway.

Hope that helps someone!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s