GithubHelp home page GithubHelp logo

snowplow / snowplow-android-tracker Goto Github PK

View Code? Open in Web Editor NEW
108.0 19.0 63.0 22 MB

Snowplow event tracker for Android. Add analytics to your Android apps and games

Home Page: http://snowplowanalytics.com

License: Apache License 2.0

Shell 0.01% Java 2.88% Kotlin 97.12%

snowplow-android-tracker's Introduction

Android Analytics for Snowplow

actively-maintained Build Status Coverage Status Release License

snowplow-logo

Snowplow is a scalable open-source platform for rich, high quality, low-latency data collection. It is designed to collect high quality, complete behavioral data for enterprise business.

To find out more, please check out the Snowplow website and our documentation.

Snowplow Android Tracker Overview

The Snowplow Android Tracker allows you to add analytics to your mobile apps when using a Snowplow pipeline.

With this tracker you can collect event data from your applications, games or frameworks.

Technical documentation can be found for each tracker in our Documentation.

Demo apps using the Snowplow Android Tracker

Three demo apps are included in this repository: one in Java, one in Kotlin, and one in Kotlin with Jetpack Compose.

Instrument the Android Tracker

Technical Docs Setup Guide API Docs
i1 i2 i3
Technical Docs Setup Guide API Docs

Maintainers

Contributing
i4
Contributing

Copyright and license

The Snowplow Android Tracker is copyright 2015-present Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

snowplow-android-tracker's People

Contributors

alexanderdean avatar alexbenny avatar antonkazakov avatar greg-el avatar jbeemster avatar jonalmeida avatar lixiaoyi avatar matus-tomlein avatar max2817 avatar mhadam avatar mscwilson avatar oguzhanunlu avatar paulboocock avatar r4md4c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snowplow-android-tracker's Issues

Call AsyncTask.get in sendGetData and setPostData will block UI thread

In sendGetData and setPostData in Emitter [0], they call AsyncTask.get to get HTTP response. sendGetData and setPostData in Emitter are called in UI thread since they use AsyncTasks. However, they also use AsyncTask.get [1] to get HTTP response, which will block the UI thread if HTTP response is not returned. It might slow down UI thread and cause bad UI experience.

[0] https://github.com/snowplow/snowplow-android-tracker/blob/master/snowplow-android-tracker/src/main/java/com/snowplowanalytics/snowplow/tracker/android/emitter/Emitter.java#L181-L217
[1] https://developer.android.com/reference/android/os/AsyncTask.html#get()

Fix library dependency warnings in Android Studio

We've put a hack on the pom file we generate by manually adding the dependencies to it:

pom.withXml {
    def dependenciesNode = asNode().appendNode('dependencies')

    //Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
    configurations.compile.allDependencies.each {
        def dependencyNode = dependenciesNode.appendNode('dependency')
        dependencyNode.appendNode('groupId', it.group)
        dependencyNode.appendNode('artifactId', it.name)
        dependencyNode.appendNode('version', it.version)
    }
}

Android Studio complains with an error that we can't have dependencies which would give the user a wrong impression.

Option 1

A possible solution would be to:

  1. Remove the pom file hack
  2. Add in our documentation, that your gradle should have the tracker-core along with the android-tracker to look something like this:
compile 'com.snowplowanalytics:android-tracker:0.1.1'
compile 'com.snowplowanalytics:snowplow-java-tracker-core:0.1.2'

Option 2

Would be to add the android-tracker to the snowplow-java-tracker build, and use the dependency project (':snowplow-java-tracker-core')

Option 3

Add the jar file of the tracker-core that we are currently using, into the android /libs project.
This let's us maintain a versioning of the core instead of the way option 2, which doesn't let us do that.

Use Google Play Services' analytic-specific library (6.5+)

Play Services will be splitting up their massive library into smaller sets. When this comes out we should update to use only the analytics part that contains the Advertising ID.

Granular Dependency Management
As we’ve continued to add more APIs across the wide range of Google services, it can be hard to maintain a lean app, particularly if you're only using a portion of the available APIs. Now with Google Play services 6.5, you’ll be able to depend only on a minimal common library and the exact APIs your app needs. This makes it very lightweight to get started with Google Play services.

See: http://android-developers.blogspot.ca/2014/11/google-play-services-65.html

Android Studio requires you to delete all subproject settings.gradle to work

First off, this isn't really a bug we can fix, but it spoils development immensely.

Because of a bug in Android Studio, there is no way to resolve subproject symbols for projects that are more that one level down. The temporary "fix" for this, is to delete the settings.gradle files for all subprojects in the snowplow-android-tracker to allow AS to recognize android-tracker and java-tracker-core as modules.

Steps:

  • Delete java-tracker/settings.gradle
  • Delete java-tracker/java-tracker-core/settings.gradle

Things we can do:

  • If this is still an issue when we release the android tracker, we need to document this in the Setup/Troubleshooting Guide.

Notes:
We can't delete the settings.gradle the other projects since we require them to function as their own projects. This is mentioned by others in the bug report as well, so this is the only workaround atm.

Leaving without milestone or assignee for now.

Fix Gradle Dynamic Version linting warning

Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds
(com.jakewharton.sdkmanager:gradle-plugin:0.12.+)

7 }
8 dependencies {
9 classpath 'com.android.tools.build:gradle:1.0.0'
10 classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
11 }
12 }

Set tv to andr-0.1.0

It's probably currently java-0.1.0 i.e. currently it's inherited from the Java Tracker, but shouldn't be.

Core: include rooted/jailbroken in mobile context

It may be useful to check whether the mobile device is rooted/jailbroken since those devices can misbehave in their own special way. This can be added into the mobile context as another attribute for iOS and Android; both checks can be easily done as well:

Android: http://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device

iOS: http://resources.infosecinstitute.com/ios-application-security-part-23-jailbreak-detection-evasion/

(@alexanderdean if you think this is a good idea, I'll create a separate issue for iOS)

Remove locally stored bufferOption

We have a BufferOption value stored the Android trackers Emitter class right now because the tracker core doesn't have access to it.

A fix would be to adding a setter/getter OR making bufferOption in java core protected.

In the Android tracker, we can then:

  1. Remove the override method setBufferOption.
  2. Adjust addToBuffer(Payload) accordingly.

Cannot publish Android Tracker 0.1.2

On a 100% fresh build using:

snowplow/ansible-playbooks#34

I get:

$ ./gradlew build
...
:snowplow-android-tracker:generateDebugResValues UP-TO-DATE
:snowplow-android-tracker:generateDebugResources UP-TO-DATE
:snowplow-android-tracker:mergeDebugResources UP-TO-DATE
:snowplow-android-tracker:processDebugManifest UP-TO-DATE
:snowplow-android-tracker:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':snowplow-android-tracker:processDebugResources'.
> java.io.IOException: Cannot run program "/home/vagrant/android-sdk-linux/build-tools/19.1.0/aapt": error=2, No such file or directory

Make an Android test app

Something simple that lets you test sending events and can be sideloaded with the apk.

Things it should do:

  • Text field to enter collector uri
  • Options to set BufferOption value
  • Send fake track events for each track* we have
  • More to add..

Create an FAQ for Android documentation

With Android there are several occasions where you can ask, why is this happening? So we can add an FAQ section to counter these:

Here is an initial list of things to document in it:

  • Add permissions for INTERNET
  • Crashing when using Subject with Context but not adding Play Services
  • Project module not recognized (See: #10)
  • Make sure java-core is updated to the right version

Fix Emitter encodes the slash in /tp2

URI.Builder encodes the '/tp2' part of our URI for post requests making it /com.snowplowanalytics.snowplow%2Ftp2.

We can fix this by using appendEncodedPath instead of appendPath.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.