##What's Countly? Countly is an innovative, real-time, open source mobile analytics application. It collects data from mobile devices, and visualizes this information to analyze mobile application usage and end-user behavior. There are two parts of Countly: the server that collects and analyzes data, and mobile SDK that sends this data. Both parts are open source with different licensing terms.
This repository includes the SDK for Android.
##Installing Android SDK
Installing Android SDK requires two very easy steps. Countly Android SDK uses OpenUDID (which comes ready with the zip file). First step is about OpenUDID requirement and second step is integrating Countly SDK to your project:
###1. Add Countly SDK to your project
Add Maven Central repository:
repositories { mavenCentral() }
Add Countly SDK dependency:
dependencies { compile 'ly.count:sdk-android:+' }
<dependency> <groupId>ly.count</groupId> <artifactId>sdk-android</artifactId> <version>14.08</version> </dependency>
Download Latest JAR and put it into your lib folder.
###2. Set up SDK
- Call
Countly.sharedInstance().init(this, "https://YOUR_SERVER", "YOUR_APP_KEY", "OPTIONAL_DEVICE_ID")
in your main activity onCreate, which requires your App key and the URL of your Countly server (usehttps://cloud.count.ly
for Countly Cloud). You can either specify your own Device ID, or omit this parameter and add OpenUDID service (it will generate unique device ID automatically) to yourAndroidManifest.xml
:
<service android:name="org.openudid.OpenUDID_service"> <intent-filter> <action android:name="org.openudid.GETUDID" /> </intent-filter> </service>
- Call
Countly.sharedInstance().onStart()
in onStart. - Call
Countly.sharedInstance().onStop()
in onStop.
Additionally, make sure that INTERNET permission is set if there's none in your manifest file.
Note: Make sure you use App Key (found under Management -> Applications) and not API Key. Entering API Key will not work.
Note: Call Countly.sharedInstance().init(...)
only once during onCreate of main activity. After that, call Countly.sharedInstance().onStart()
and Countly.sharedInstance().onStop()
in each of your activities' onStart()
and onStop()
methods.
###3. Use some extra features How can I make sure that requests to Countly are sent correctly?
Enable logging: Countly.sharedInstance().setLoggingEnabled(true)
I'm already using OpenUDID in my project, how can I remove it from build?
There is custom_rules.xml
ant build file, check it out. Or you can just use sources instead of jars.
###4. Other
Check Countly Server source code here:
There are also other Countly SDK repositories below:
- Countly iOS SDK
- Countly Android SDK
- Countly Windows Phone SDK
- Countly Blackberry Webworks SDK
- Countly Blackberry Cascades SDK (Community supported)
- Countly Mac OS X SDK (Community supported)
- Countly Appcelerator Titanium SDK (Community supported)
- Countly Unity3D SDK (Community supported)
##How can I help you with your efforts? Glad you asked. We need ideas, feedbacks and constructive comments. All your suggestions will be taken care with upmost importance.
We are on Twitter and Facebook if you would like to keep up with our fast progress!
For community support page, see http://support.count.ly.