This is an Air native extension for Flurry analytics on the iOS and Android platforms.
This is version 0.4.0 of this extension. The compiled extension contains version 3.0.9 of the Flurry Analytics library for iOS and version 2.2.5 of the Flurry Analytics library for Android.
If you wish to use a different version of the Flurry Analytics library, you may do so by following the instructions below to compile the extension.
The bin folder contains the compiled extension and the default swc, which can be used for local testing if required by your development environment (Flash Builder shouldn’t need it, but other IDEs may).
If you want to compile the extension from scratch (e.g. to include a different version of the Flurry SDK) this is how to do it.
Requirements – Adobe Air SDK 3.1 or later, XCode IDE, iOS SDK 5.0 or later, Android SDK 2.2 or later, Java SDK, Flurry Analytics iPhone SDK and Flurry Analytics Android SDK, Apache Ant
- iOS
- Download the Flurry analytics code from your Flurry account.
- From the iOS Flurry SDK add the downloaded folder FlurryAnalytics (containing FlurryAnalytics.h & libFlurryAnalytics.a) to the ios/FlurryIosExtension folder in the project.
- Add the FlashRuntimeExtensions.h file from the Adobe Air sdk to the ios/FlurryIosExtension folder in the project.
- Android
- Download the Flurry analytics code from your Flurry account.
- From the Android Flurry SDK add the downloaded file FlurryAgent.jar to the android/libs folder in the project.
- Add the FlashRuntimeExtensions.jar file from the Adobe Air sdk to the android/libs folder in the project.
- Create a copy of the build/example.build.config file in the build folder, calling it build.config and change the properties in this file to match your system.
- A certificate is required by the build script. This may be a self-signed certificate created by Adobe Air.
- Run the ant build script build.xml. This creates the native extension, and default swc file, inside the bin folder.
At its simplest, you initialize the extension with your application’s identifier as follows
Flurry.startSession( "your flurry id" );
You should only start the session once, after which you can log as many events as you wish.
On Android, this ends the current session (and sends the accumulated event data to Flurry). On iOS it does nothing, the session automatically ends when your app enters the background.
Flurry.endSession();
You may then log events with Flurry like this
Flurry.logEvent( "User did something" );
You can pass parameters through to a Flurry event via a simple object, as follows
Flurry.logEvent( "Screen resolution", { width : Capabilities.screenResolutionX, height : Capabilities.screenResolutionY, dpi : Capabilities.screenDPI } );
Flurry will also log timed events. This is a two-step process. You first start the timed event.
Flurry.startTimedEvent( "User playing game" );
Then, later, you end the timed event.
Flurry.endTimedEvent( "User playing game" );
You can also log errors with Flurry
Flurry.logError( "NullPointer", "Attempt to use a reference to a null pointer" );
That’s just a starter. All the features of the Flurry api have been implemented. Read the documentation in the Actionscript source code for all the features.
The extension requires that your project is built against version 5 of the iOS SDK. It doesn’t require version 5 at run-time (version 4 is sufficient), but it is required at compile-time.
With Air 3.3 or later, just include the extension in the usual way.
With Air 3.1 or 3.2, your project it must be compiled on a computer running Mac OS X and with version 5 or later of the iOS SDK. Specify the path to the iOS SDK when compiling the project using the functionality built in to your IDE or the platformsdk parameter if building with adt from the command line or a build script.
Air Native Extension for Flurry analytics on iOS & Android
Author: Richard Lord
Owner: Stick Sports Ltd.
http://www.sticksports.com
Copyright © 2011, Stick Sports Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Stick Sports Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.