kissmetrics / kissmetrics-android-sdk Goto Github PK
View Code? Open in Web Editor NEWAndroid SDK for KISSmetrics
Home Page: https://bintray.com/kissmetrics/SDKs/KISSmetrics-Android-SDK/view
License: Apache License 2.0
Android SDK for KISSmetrics
Home Page: https://bintray.com/kissmetrics/SDKs/KISSmetrics-Android-SDK/view
License: Apache License 2.0
** This repository is now deprecated, please see https://github.com/kissmetrics/KISSmetrics/releases/tag/v1.0.0 for the final versions of all included clients ** KISSmetrics is different from other analytics platforms due to a combination of three key features. We focus on funnels and conversions and make them easy to track and interpret, use people as the basic unit of measure, and support tracking of highly-flexible custom data through our simple API. Find out more at http://www.kissmetrics.com * ruby client has moved to https://github.com/kissmetrics/km * php client has moved to https://github.com/kissmetrics/kissmetrics-php * python client has moved to https://github.com/kissmetrics/py-KISSmetrics * perl client is complete with crontab option (untested)
0java.lang.NullPointerException
1 at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:818)
2 at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
3 at libcore.net.http.HttpURLConnectionImpl.getHeaderFields(HttpURLConnectionImpl.java:158)
4 at libcore.net.http.HttpsURLConnectionImpl.getHeaderFields(HttpsURLConnectionImpl.java:231)
5 at com.splunk.mint.network.http.MonitorableHttpsURLConnection.disconnect(MonitorableHttpsURLConnection.java:57)
6 at com.kissmetrics.sdk.ConnectionImpl.sendRecord(ConnectionImpl.java:98)
7 at com.kissmetrics.sdk.SenderReadyState.sendTopRecord(SenderReadyState.java:36)
8 at com.kissmetrics.sdk.SenderReadyState.access$0(SenderReadyState.java:31)
9 at com.kissmetrics.sdk.SenderReadyState$1.run(SenderReadyState.java:54)
10 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
12 at java.lang.Thread.run(Thread.java:856)
When a null value is given to QueryEncoder this condition throws null pointer exception.
Try using TextUtils.isEmpty(str)..
String stringValue = properties.get(stringKey);
if (stringValue.length() == 0) {
Log.w("KISSmetricsAPI",
"Property values must not be empty strings. Dropping property.");
log:
E/AndroidRuntime( 1381): java.lang.NullPointerException
E/AndroidRuntime( 1381): at com.kissmetrics.sdk.QueryEncoder.encodeProperties(QueryEncoder.java:164)
E/AndroidRuntime( 1381): at com.kissmetrics.sdk.QueryEncoder.createEventQuery(QueryEncoder.java:207)
E/AndroidRuntime( 1381): at com.kissmetrics.sdk.ArchiverImpl.archiveEvent(ArchiverImpl.java:539)
E/AndroidRuntime( 1381): at com.kissmetrics.sdk.TrackingRunnablesTrackingState$4.run(TrackingRunnablesTrackingState.java:113)
E/AndroidRuntime( 1381): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
E/AndroidRuntime( 1381): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
E/AndroidRuntime( 1381): at java.lang.Thread.run(Thread.java:841)
What's up doc?
Is no secret that HttpUrlConnection have some bugs on Android, but I am not sure about this exception is HttpUrlConnection...
java.io.EOFException
at libcore.io.Streams.readAsciiLine(Streams.java:203)
at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:579)
at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:827)
Right after the logcat prints
V/KISSmetricsAPI(22429): verifyTracking
To workaround it I just changed to OkHttp (added the jar in the libs folder ) and overrided a method from ConnectionImpl to create an OkHttpConnectionImpl
public class OkHttpConnectionImpl extends ConnectionImpl {
private OkHttpClient okHttpClient = new OkHttpClient();
/**
* Opens a connection from a URL. Allows for injection of mock HttpURLConnection via method override.
*
* @param url
* API query URL
* @return HttpURLConnection from the URL
* @throws IOException
*/
protected HttpURLConnection createHttpURLConnection(URL url) throws IOException {
return okHttpClient.open(url);
}
}
( You can see it here https://github.com/BugsBunnyBR/KISSmetrics-Android-SDK/blob/master/KISSmetricsAPIIntegration/src/com/kissmetrics/sdk/OkHttpConnectionImpl.java )
Of course I also changed the method in KISSMetricsAPI.java
protected static ConnectionImpl connection() {
if (connectionImpl == null) {
connectionImpl = new OkHttpConnectionImpl();
}
return connectionImpl;
}
I haven't tested it much, but that error is not happening to me anymore..
Hope to help someone.
That's all folks.
Hi, I would like to know how to compile the project? The API folder does not seems to be a valid project since it has the android class loader in the path, but does not have the AndroidManifest.xml or project.properties.
For now, I moved the API files from KISSmetricsAPI/src/com/kissmetrics/ to KISSmetricsAPIIntegration/src/com/kissmetrics/
and imported the Android project.
I am using Android Studio and would like to integrate the Kissmetrics SDK using a dependency in my build.gradle file. The SDK as present here needs to be imported by either adding the classes to my project or create a library project.
Hi, would you please implement a way to disable the event counting while in debug mode?
Maybe a parameter like:
boolean debug = true;
KISSmetricsAPI.sharedAPI(context.getString(R.string.kiss_metrics_key), context.getApplicationContext(), debug);
Thanks
Got it while initializing the lib
java.lang.NoSuchMethodError: fli
at java.lang.Class.getConstructorOrMethod(Class.java:460)
at java.lang.Class.getDeclaredMethod(Class.java:685)
at java.io.ObjectStreamClass.findMethod(ObjectStreamClass.java:1111)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:299)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1069)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1037)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:248)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1069)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1037)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:248)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1069)
at java.io.ObjectInputStream.verifyAndInit(ObjectInputStream.java:2371)
at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1658)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:683)
at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1799)
at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:787)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1999)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1956)
at com.kissmetrics.sdk.ArchiverImpl.unarchiveSettings(ArchiverImpl.java:146)
at com.kissmetrics.sdk.ArchiverImpl.<init>(ArchiverImpl.java:88)
at com.kissmetrics.sdk.ArchiverImpl.sharedArchiver(ArchiverImpl.java:108)
at com.kissmetrics.sdk.KISSmetricsAPI.<init>(KISSmetricsAPI.java:91)
at com.kissmetrics.sdk.KISSmetricsAPI.sharedAPI(KISSmetricsAPI.java:137)
JCenter is shutting down, wont be available after February 1st 2022,
Any plans to migrate
https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)
at java.util.HashMap$KeyIterator.next(HashMap.java:833)
at com.kissmetrics.sdk.QueryEncoder.encodeProperties(QueryEncoder.java:142)
at com.kissmetrics.sdk.QueryEncoder.createEventQuery(QueryEncoder.java:207)
at com.kissmetrics.sdk.ArchiverImpl.archiveEvent(ArchiverImpl.java:539)
at com.kissmetrics.sdk.TrackingRunnablesTrackingState$4.run(TrackingRunnablesTrackingState.java:113)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
version: KISSmetricsSDKKv2.0.5
W/KISSmetricsAPI﹕ Verification experienced an Exception: java.net.SocketException: Socket is closed
the call KISSmetricsAPI.sharedAPI().record does not allow record parameters togther with the event name.
Would be great to have something like
KISSmetricsAPI.sharedAPI().record(eventName, params);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.