Upgrade to Android SDK 6.x.x from SDK 4.x

Upgrading the Flurry Android SDK from version 4.x to 6.x.x is straightforward and should take less than 10 minutes to perform.

Upgrade Flurry Analytics

Follow these steps to upgrade Flurry Analytics:

Upgrade using Android Studio:

  1. Remove the existing Flurry library jars from the libs folder.

  2. Add FlurryAnalytics-6.x.jar to your project’s libs folder.

Upgrade using Eclipse:

  1. Remove any existing Flurry library jars from your project’s lib folder. Also, remove all reference from the Build Path.

  2. Add FlurryAnalytics­6.x.jar to your project’s libs folder. Right-click on each JAR file and select Build Path > Add to Build Path.

Introducing a New Initialization Function

FlurryAgent has a new initialization function, FlurryAgent.init(), that must be called as soon as possible after your app is started.

Any FlurryAgent configuration that was previously done before a session was started should be done before init instead. It is recommended that you call this function in the onCreate() method of your Application class. If you do not currently extend the Application class in your app, you can do so by adding a class such as this:


and in your AndroidManifest.xml, declaring the application to point to your new application class:



You may also call FlurryAgent.init() just before FlurryAgent.onStartSession(). It is safe to call FlurryAgent.init() more than once provided that the same API key is always used during the lifetime of the application.

onStartSession and onEndSession

Sessions are automatically tracked on Ice Cream Sandwich (API level 14) and above. If the minSdkVersion for your app is set to 14 or greater, you no longer need to manually call onStartSession() and onEndSession() unless you are tracking sessions using a Context that is not an Activity (i.e. a Service). You may safely remove these methods from your code. Apps that run on Gingerbread or Honeycomb or use context that is not an activity will still need to call onStartSession() and onEndSession() as before.

Location Tracking

Location tracking is now passive and will use cached location instead of active GPS to avoid excessive battery usage. You may call FlurryAgent.setLocation() to set the location manually if your app uses the GPS.

Modified Methods

FlurryAgent.onStartSession(Context context, String apiKey) is now deprecated. Use FlurryAgent.onStartSession(Context context) instead. The API key is now supplied in the FlurryAgent.init() function and is no longer required here.

Removed Methods

  • FlurryAgent.getUseHttps()

  • FlurryAgent.setUseHttps(boolean useHttps)

HTTPS is now mandatory due to Google Play! Store restrictions. These methods have been removed from the SDK and should be completely removed from your app.

Upgrade Flurry Ads

Follow these steps to upgrade Flurry Ads:

Upgrade using Android Studio:

  1. Make sure you first follow the steps for Flurry Analytics integration listed above. The Ads jar is dependent on the Analytics jar.

  2. Add FlurryAds-6.x.jar to your project’s libs folder.

  3. Navigate to File -> Project Structure -> Module -> Dependencies.

  4. Click the ‘+’ button in the bottom of the ‘Project Structure’ popup to add dependencies.

  5. Select ‘File dependency’ and add libs/FlurryAds-6.x.jar.

Upgrade using Eclipse:

  1. Make sure you first follow the steps for Flurry Analytics integration listed above. The Ads jar is dependent on the Analytics jar.

  2. Add FlurryAds-6.x.jar to your project’s libs folder.

  3. Right-click on the Ads JAR file and select Build Path > Add to Build Path.

Code Size

The size and method count of the Flurry Ads SDK has been significantly reduced in this release. This is code optimization and does not affect any functionality.

Native Ads

The Flurry Ads SDK now includes support for Native Ads, which can be fully customized to the look and feel of your application. Please refer to the Ads README if you wish to include Native Ads in your app.

New Object-Based API

A new object-based API for Ads has been introduced to make integration even easier than before. Flurry recommends that developers switch to the new ads API as soon as possible. The FlurryAds API will continue to work as before, but has been deprecated. Also, the new API is required for Native Ads. Refer to the Ads README for more details.

Note that if you are using Flurry to mediate a third-party SDK with ICustomAdNetworkHandler, you need to continue using the old API to serve ads for this network.