Initialize Flurry¶
Add the following calls to initialize the Flurry SDK by using the FlurryAgent.Builder to initialize the Flurry SDK with your project’s API key. We generally expect users to initialize FlurryAgent in their Application class, and pass in the Application context. Flurry starts a new session when the next Activity is in the foreground.
If your app can only initialize the FlurryAgent in an Activity, passing the Application context will cause the session not to start until the next Activity comes into the foreground. In this case, pass the Activity context instead to initialize FlurryAgent. The new session will start immediately.
It is safe to call the Builder more than once, provided that you use the same API key throughout the application.
Now test run your Android app and ensure that it builds and runs without errors. If everything is working properly, a session will be recorded in Flurry and should be visible on your Real Time dashboard within 30 seconds**.
Important
If you created the Flurry app within the last 5 minutes, the app may not yet be live on our servers and thus will not reflect real-time data. Re-run your app after 5 minutes to see your session recorded on the Real Time dashboard.
Congratulations! Your Android app is now ready to be used with Flurry Analytics.