This is how I added Flurry:
Add FlurryAnalytics_3.3.2.jar (or the last one) to the libs folder (create this directory if necessary)
Add compile fileTree(dir: 'libs', include: '*.jar') depending on the build.gradle project
dependencies {compile fileTree (dir: 'libs', include: '* .jar')}
or Gradle + Jcenter compile 'com.flurry.android:analytics:6.2.0'
Add the appropriate permissions for AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Make sure that the versionName attribute is specified in AndroidManifest.xml to have the data specified under this name, for example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0">
If necessary, add the Flurry API key to the constant file, for example, AppConstants.java:
public class AppConstants { public static final String FLURRY_API_KEY = "YOUR_API_KEY";
Add Flurry onStartSession and onEndSession to each action in your application:
@Override protected void onStart() { super.onStart(); FlurryAgent.onStartSession(this, AppConstants.FLURRY_API_KEY); } @Override protected void onStop() { super.onStop(); FlurryAgent.onEndSession(this); }
I still had some problems at the moment and chose the hint recommended by Android Studio when viewing the build.gradle file. He changed gradle -1.8-bin.zip to gradle -1.8-bin.zip to gradle -1.8-all.zip in gradle / wrapper / gradle -wrapper.properties:
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip
After that, my project worked successfully and started logging Flurry events. FYI, it takes hours to see the magazines in Flurry.
This is a good link for Android Studio and gradle.
And, of course, Flurry is provided with details for most of this as well.
David m
source share