简体   繁体   中英

Flurry SDK for Android 2.1?

Is there a version of the Flurry SDK for Android 2.1?

Thanks.

Yes the Flurry SDK works for Android 2.1. What you need to do is following. Sign up here: www.flurry.com

After this you'll have to create a new Project, than do following steps:

  1. Add FlurryAgent.jar to your application's classpath

    • If you're using Eclipse, modify your Java Build Path, and choose Add External JAR... or use Gradle + Jcenter compile 'com.flurry.android:analytics:6.2.0'
    • If you're using the SDK tools directly, drop it into your libs folder and the ant task will pick it up.
  2. Configure AndroidManifest.xml

Required Permission:

android.permission.INTERNET

Required to send analytics data back to the flurry servers Optional Permission:

android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION

If your application has location permissions, analytics will track where your application is being used. Without this, only country level location information will be available. To disable detailed location reporting even when your app has permission, call FlurryAgent.setReportLocation(false) before calling FlurryAgent.onStartSession() and no detailed location information will be sent. Specify a versionName attribute in the manifest to have data reported under that version name.

3.Add calls to onStartSession and onEndSession

Insert a call to FlurryAgent.onStartSession(Context, String ), passing it a reference to a Context object (such as an Activity or Service), and your application's API key [YOURAPIKEYRIGHTHERE]. We recommend using the onStart method of each Activity in your application, and passing the Activity (or Service) itself as the Context object - passing the global Application context is not recommended.

public void onStart()
{
   super.onStart();
   FlurryAgent.onStartSession(this, "YOURAPIKEYRIGHTHERE");
   // your code
}

Insert a call to FlurryAgent.onEndSession(Context) when a session is complete. We recommend using the onStop method of each Activity in your application. Make sure to match up a call to onEndSession for each call of onStartSession, passing in the same Context object that was used to call onStartSession

public void onStop()
{
   super.onStop();
   FlurryAgent.onEndSession(this);
   // your code
}

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. Session length, usage frequency, events and errors will continue to be tracked as part of the same session. This ensures that as a user transitions from one Activity to another in your application that they will not have a separate session tracked for each Activity, but will have a single session that spans many Activities. If you want to track Activity usage, we recommend using onEvent, described below. 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 .

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 .

I hope I could help you!

Have a great day!

safari

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM