Flurry (link) is a solution for analytics tracking on mobile devices.
This wrapper uses the Android Java classes built in to Unity to operate on the Flurry SDK. The included version of the Flurry Android SDK is 2.1.
The methods, and arguments of the Unity wrapper all correspond to the same methods on the FlurryAgent Java class.
Notes
Call ‘onEndSession’ from OnApplicationPause(true) as well as OnApplicationQuit()
Call ‘onStartSession’ from OnApplicationPause(false)
Use ‘setContinueSessionMillis’ to adjust the timeout on starting a new session vs. continuing the existing session. This interacts with OnApplicationPause functionality, since using something like the OpenFeint dashboard, or Google’s In-App Billing will cause a call to OnApplicationPause. The default value is 10 seconds. See the Flurry documentation for more information.
Known Issues
I’m not kidding…call onEndSession properly or you will not see your events show up.
The ‘setGender’ method is not implemented because I don’t need it and I didn’t really want to muck about with pulling the constants out of the Flurry class.
Is this in the editor, or on the Android device. As far as I know, the AndroidJNI classes will only bind the Java methods on the Android device. In the editor, you will get that warning.
Possibly, are you calling onStartSession from anywhere but ApplicationPause? The first launch of your application will not invoke Pause, so you will likely want it in Start() also.
The reason you want it in Pause is because, if your application is exited and then resumed (via pressing the home button or whatever) than on resume, you will not get a call to Start() again, because Start() already happened during the previous session.
If you’re still having that problem, my guess is the FlurryAgent.jar isn’t being imported properly. I can’t point to any posts, but I seem to remember some people having trouble with .jar’s not updating.
And huge thanks to you ZeroStride, this plugin was amazing!
Hi guys, i’m having the same problem as eltonbird. The package name might be the problem? Do you guys have modified the manifest file to get it working?
A couple of notes for others who stumble upon here. Read This
Highly recommended so that you know what is going on.
If your app crashes on load make sure AndroidJavaClass(“com.flurry.android.FlurryAgent”); is not failing.
If it is failing make sure your .jar file is in the correct location otherwise Unity won’t find it.
Make sure the .jar file goes in Assets/Plugins/Android. I had mine in Assets/Assets/Plugins/Android and that caught me out for a few hours!
I have a query that have you implemented the functions for App Circle in .jar as I have tried to access appCircle default function names but unity giving error. Flurry Analytic is working fine.
I downloaded the sdk ( the first comment of the post )
Put FlurryAgent.cs FlurryAgent.jar in Assets/ Plugin / Android…
Created a Script called “Example.cs” attached on an Object which is always active.
on the Start() function write these strings :
_FlurryAgent = new FlurryAgent(); // need to Initialize the script
_FlurryAgent.onStartSession("insert here your unique ID of the app");
_FlurryAgent.logEvent("Application is opened"); // on your events web site, you'll get this notification.
_FlurryAgent.onPageView(); // to increment the analytics.
Remember to call only once onStartSession() before opening a new one. You must CLOSE it before calling onStartSession() another time.
Then write this code inside the Example.cs :
public void OnApplicationQuit()
{
_FlurryAgent.onEndSession();
}
Then you have to set up your Manifest :
add this code after your activities :