├── analytics-samples ├── kotlin-sample │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── ic_launcher-playstore.png │ │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ ├── ic_launcher_background.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ ├── ic_launcher_background.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ ├── ic_launcher_background.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ ├── ic_launcher_background.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ ├── ic_launcher_background.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── font │ │ │ │ ├── sgmt_postgrotesk_medium.ttf │ │ │ │ └── font.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── menu │ │ │ │ └── menu.xml │ │ │ ├── layout │ │ │ │ └── activity_screen.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── kotlin_sample │ │ │ └── ScreenActivity.kt │ ├── proguard-rules.pro │ └── build.gradle ├── analytics-sample │ ├── src │ │ ├── main │ │ │ ├── assets │ │ │ │ └── fonts │ │ │ │ │ ├── Aleo-Regular.otf │ │ │ │ │ └── CircularStd-Book.otf │ │ │ ├── ic_launcher-web.png │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ ├── dimens.xml │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── values-w820dp │ │ │ │ │ └── dimens.xml │ │ │ │ ├── menu │ │ │ │ │ └── main.xml │ │ │ │ └── layout │ │ │ │ │ └── activity_main.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── segment │ │ │ │ └── analytics │ │ │ │ └── sample │ │ │ │ └── MainActivity.java │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── segment │ │ │ └── analytics │ │ │ └── webhook │ │ │ └── WebhookService.java │ ├── proguard-rules.txt │ └── build.gradle └── analytics-wear-sample │ ├── src │ └── main │ │ ├── res │ │ ├── drawable-xxhdpi │ │ │ ├── icon.png │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ └── strings.xml │ │ └── layout │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── segment │ │ └── analytics │ │ └── sample │ │ └── MainActivity.java │ └── build.gradle ├── analytics ├── gradle.properties ├── libs │ └── objenesis-2.6.jar ├── proguard-rules-lib.txt ├── src │ ├── test │ │ └── java │ │ │ ├── android │ │ │ └── net │ │ │ │ └── http │ │ │ │ └── AndroidHttpClient.java │ │ │ └── com │ │ │ └── segment │ │ │ └── analytics │ │ │ ├── Utils.java │ │ │ ├── CryptoTest.kt │ │ │ ├── integrations │ │ │ ├── IdentifyPayloadTest.kt │ │ │ ├── AliasPayloadTest.kt │ │ │ ├── TrackPayloadTest.kt │ │ │ ├── ScreenPayloadTest.kt │ │ │ └── GroupPayloadTest.kt │ │ │ ├── ValueMapCacheTest.kt │ │ │ ├── ProjectSettingsTest.kt │ │ │ ├── BatchPayloadWriterTest.kt │ │ │ ├── OptionsTest.kt │ │ │ ├── GetAdvertisingIdTest.kt │ │ │ ├── SourceMiddlewareTest.kt │ │ │ └── PayloadQueueTest.kt │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── segment │ │ └── analytics │ │ ├── Middleware.java │ │ ├── Crypto.java │ │ ├── BooleanPreference.java │ │ ├── JSMiddleware.java │ │ ├── internal │ │ ├── Private.java │ │ └── NanoDate.java │ │ ├── MiddlewareChainRunner.java │ │ ├── integrations │ │ ├── Logger.java │ │ ├── Integration.java │ │ └── AliasPayload.java │ │ ├── ProjectSettings.java │ │ ├── ConnectionFactory.java │ │ ├── StatsSnapshot.java │ │ └── PayloadQueue.java └── build.gradle ├── analytics-tests ├── gradle.properties ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── segment │ └── analytics │ ├── Utils.java │ └── test │ ├── IdentifyPayloadBuilder.java │ ├── AliasPayloadBuilder.java │ ├── GroupPayloadBuilder.java │ ├── TrackPayloadBuilder.java │ └── ScreenPayloadBuilder.java ├── analytics-wear ├── gradle.properties ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── segment │ └── analytics │ ├── WearTrackPayload.java │ ├── WearPayload.java │ ├── WearScreenPayload.java │ └── PhoneAnalyticsListenerService.java ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── versioning.gradle ├── promote.gradle ├── attach-jar.gradle ├── android.gradle └── mvn-publish.gradle ├── settings.gradle ├── CONTRIBUTING.md ├── gradle.properties ├── LICENSE.md ├── .buildscript └── deploy_snapshot.sh ├── RELEASING.md ├── gradlew.bat ├── .gitignore └── .circleci └── config.yml /analytics-samples/kotlin-sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/assets/fonts/Aleo-Regular.otf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /analytics/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=Segment Android Analytics 2 | POM_ARTIFACT_ID=analytics 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /analytics/libs/objenesis-2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics/libs/objenesis-2.6.jar -------------------------------------------------------------------------------- /analytics-tests/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=Segment Android Analytics 2 | POM_ARTIFACT_ID=analytics-tests 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /analytics-wear/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=Segment Android Wear Analytics 2 | POM_ARTIFACT_ID=analytics-wear 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /analytics/proguard-rules-lib.txt: -------------------------------------------------------------------------------- 1 | -keepclassmembers class com.segment.analytics.** extends com.segment.analytics.ValueMap { 2 | (java.util.Map); 3 | } 4 | -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-sample/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/assets/fonts/CircularStd-Book.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-sample/src/main/assets/fonts/CircularStd-Book.otf -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/analytics-wear-sample/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-wear-sample/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /analytics-samples/analytics-wear-sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Segment Wear Sample 5 | 6 | 7 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/font/sgmt_postgrotesk_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/font/sgmt_postgrotesk_medium.ttf -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /analytics-samples/analytics-wear-sample/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/analytics-wear-sample/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/segmentio/analytics-android/HEAD/analytics-samples/kotlin-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'analytics' 2 | include 'analytics-tests' 3 | include 'analytics-wear' 4 | include 'analytics-samples:analytics-sample' 5 | include 'analytics-samples:analytics-wear-sample' 6 | include 'analytics-samples:kotlin-sample' -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #52bd95 4 | #12424a 5 | #edf0ed 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Dec 08 11:48:01 PST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip 7 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/font/font.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/versioning.gradle: -------------------------------------------------------------------------------- 1 | def isReleaseBuild() { 2 | return hasProperty('release') 3 | } 4 | 5 | def getVersionName() { // If not release build add SNAPSHOT suffix 6 | return isReleaseBuild() ? VERSION_NAME : VERSION_NAME+"-SNAPSHOT" 7 | } 8 | 9 | ext { 10 | isReleaseBuild = this.&isReleaseBuild 11 | getVersionName = this.&getVersionName 12 | } -------------------------------------------------------------------------------- /analytics-tests/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | apply from: rootProject.file('gradle/android.gradle') 4 | 5 | dependencies { 6 | api project(':analytics') 7 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 8 | } 9 | 10 | apply from: rootProject.file('gradle/attach-jar.gradle') 11 | //apply from: rootProject.file('gradle/mvn-publish.gradle') 12 | repositories { 13 | mavenCentral() 14 | } 15 | -------------------------------------------------------------------------------- /analytics-wear/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | apply from: rootProject.file('gradle/android.gradle') 4 | 5 | dependencies { 6 | api project(':analytics') 7 | 8 | // TODO: we should update this dependency. 9 | //noinspection GradleDependency 10 | api 'com.google.android.gms:play-services-wearable:10.2.6' 11 | } 12 | 13 | apply from: rootProject.file('gradle/mvn-publish.gradle') 14 | repositories { 15 | mavenCentral() 16 | } 17 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 14 | -------------------------------------------------------------------------------- /gradle/promote.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'io.codearte.nexus-staging' 2 | 3 | if (!hasProperty("SONATYPE_STAGING_PROFILE_ID")) { 4 | ext["NEXUS_USERNAME"] = System.getenv('NEXUS_USERNAME') 5 | ext["NEXUS_PASSWORD"] = System.getenv('NEXUS_PASSWORD') 6 | ext["SONATYPE_STAGING_PROFILE_ID"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') 7 | } 8 | 9 | nexusStaging { 10 | packageGroup = "com.segment.analytics.android" 11 | stagingProfileId = SONATYPE_STAGING_PROFILE_ID 12 | username = NEXUS_USERNAME 13 | password = NEXUS_PASSWORD 14 | } -------------------------------------------------------------------------------- /gradle/attach-jar.gradle: -------------------------------------------------------------------------------- 1 | // Attaches a JAR to the archives artifact for a library 2 | android.libraryVariants.all { variant -> 3 | // Only attach a jar for non-debug build types. 4 | if (!variant.buildType.isDebuggable()) { 5 | def name = variant.buildType.name 6 | def task = project.tasks.create "jar${name.capitalize()}", Jar 7 | task.dependsOn variant.javaCompile 8 | // Include Java classes 9 | task.from variant.javaCompile.destinationDir 10 | artifacts.add('archives', task); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | If you would like to contribute code to `analytics-android` you can do so through 5 | GitHub by forking the repository and opening a pull request against `master`. 6 | 7 | When submitting code, please make every effort to follow existing conventions 8 | and style in order to keep the code as readable as possible. Please also make 9 | sure your code compiles by running `make build test`. In addition please consider adding 10 | unit tests covering your change, this will make your change much more likely to be accepted 11 | 12 | Above all, thank you for contributing! 13 | -------------------------------------------------------------------------------- /analytics-samples/analytics-wear-sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply from: rootProject.file('gradle/android.gradle') 4 | 5 | android { 6 | defaultConfig { 7 | minSdkVersion rootProject.ext.minSdkVersionWear 8 | } 9 | 10 | lintOptions { 11 | // Since this is just a sample app, it's ok to ignore these warnings. 12 | disable 'IconMissingDensityFolder', 'GoogleAppIndexingWarning', 'AllowBackup' 13 | } 14 | } 15 | 16 | dependencies { 17 | implementation project(':analytics') 18 | implementation project(':analytics-wear') 19 | implementation 'androidx.wear:wear:1.0.0' 20 | } 21 | repositories { 22 | mavenCentral() 23 | } 24 | -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/prateek/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | GROUP=com.segment.analytics.android 2 | 3 | VERSION_CODE=4114 4 | VERSION_NAME=4.11.4 5 | 6 | POM_NAME=Segment for Android 7 | POM_DESCRIPTION=The hassle-free way to add analytics to your Android app. 8 | 9 | POM_URL=http://github.com/segmentio/analytics-android 10 | POM_SCM_URL=http://github.com/segmentio/analytics-android 11 | POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/analytics-android.git 12 | POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segmentio/analytics-android.git 13 | 14 | POM_LICENCE_NAME=The MIT License (MIT) 15 | POM_LICENCE_URL=http://opensource.org/licenses/MIT 16 | POM_LICENCE_DIST=repo 17 | 18 | POM_DEVELOPER_ID=segmentio 19 | POM_DEVELOPER_NAME=Segment, Inc. 20 | 21 | org.gradle.jvmargs=-Xmx2048m 22 | org.gradle.daemon=false 23 | android.useAndroidX=true 24 | android.enableJetifier=true 25 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Segment Sample 3 | Docs 4 | #12424a 5 | Track Button A 6 | Track Button B 7 | Flush 8 | Name 9 | Email 10 | Age 11 | Identify 12 | Screen 13 | Group ID 14 | Group 15 | No username 16 | Alias 17 | New ID 18 | Reset ID 19 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Segment.io, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /analytics-samples/analytics-wear-sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /gradle/android.gradle: -------------------------------------------------------------------------------- 1 | 2 | android { 3 | compileSdkVersion rootProject.ext.compileSdkVersion 4 | 5 | defaultConfig { 6 | minSdkVersion rootProject.ext.minSdkVersion 7 | targetSdkVersion rootProject.ext.targetSdkVersion 8 | versionCode rootProject.ext.versionCode 9 | versionName rootProject.ext.versionName 10 | } 11 | 12 | dexOptions { 13 | preDexLibraries rootProject.ext.preDexLibraries 14 | } 15 | 16 | packagingOptions { 17 | exclude 'LICENSE.txt' 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | } 24 | } 25 | 26 | compileOptions { 27 | sourceCompatibility rootProject.ext.sourceCompatibilityVersion 28 | targetCompatibility rootProject.ext.targetCompatibilityVersion 29 | } 30 | 31 | lintOptions { 32 | textReport true 33 | textOutput 'stdout' 34 | disable 'InvalidPackage', 'GradleCompatible' 35 | } 36 | 37 | testOptions { 38 | unitTests.all { 39 | systemProperty 'robolectric.dependency.repo.url', 'https://repo1.maven.org/maven2' 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /.buildscript/deploy_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Deploy to Sonatype's snapshot repo. 4 | # 5 | # Adapted from https://coderwall.com/p/9b_lfq, 6 | # http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ 7 | # and https://github.com/square/javawriter 8 | 9 | REPO="analytics-android" 10 | USERNAME="segmentio" 11 | JDK="oraclejdk8" 12 | BRANCH="master" 13 | 14 | if [ "$CIRCLE_PROJECT_REPONAME" != "$REPO" ]; then 15 | echo "Skipping snapshot deployment: wrong repository. Expected '$REPO' but was '$CIRCLE_PROJECT_REPONAME'." 16 | elif [ "$CIRCLE_PROJECT_USERNAME" != "$USERNAME" ]; then 17 | echo "Skipping snapshot deployment: wrong owner. Expected '$USERNAME' but was '$CIRCLE_PROJECT_USERNAME'." 18 | elif [ "$CIRCLE_JDK_VERSION" != "$JDK" ]; then 19 | # $CIRCLE_JDK_VERSION must be manually set in circle.yml 20 | echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$CIRCLE_JDK_VERSION'." 21 | elif [ "$CIRCLE_BRANCH" != "$BRANCH" ]; then 22 | echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$CIRCLE_BRANCH'." 23 | else 24 | echo "Deploying snapshot..." 25 | # ORG_GRADLE_PROJECT_FOO makes 'FOO' a gradle property automatically 26 | ./gradlew uploadArchives 27 | echo "Snapshot deployed!" 28 | fi 29 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | Releasing 2 | ========= 3 | 4 | 1. Create a new branch called `release/X.Y.Z` 5 | 2. `git checkout -b release/X.Y.Z` 6 | 3. Change the version in `gradle.properties` to your desired release version 7 | 4. Update the `CHANGELOG.md` for the impending release. 8 | 5. `git commit -am "Create release X.Y.Z."` (where X.Y.Z is the new version) 9 | 6. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version) 10 | 7. Upgrade to next version by changing version in `gradle.properties` 11 | 8. `git commit -am "Prepare snapshot X.Y.Z-SNAPSHOT"` 12 | 9. `git push && git push --tags` 13 | 10. Create a PR to merge the new branch into `master` 14 | 11. The CI pipeline will recognize the tag and upload, close and promote the artifacts automatically 15 | 16 | Example (stable release) 17 | ======== 18 | 1. Current VERSION_NAME in `gradle.properties` = 4.9.1 19 | 2. `git checkout -b release/4.9.2` 20 | 3. Change VERSION_NAME = 4.9.2 (next higher version) 21 | 4. Update CHANGELOG.md 22 | 5. `git commit -am "Create release 4.9.2"` 23 | 6. `git tag -a 4.9.2 -m "Version 4.9.2"` 24 | 6. `git push && git push --tags` 25 | 7. Change VERSION_NAME = 4.9.3 (next higher version) 26 | 8. `git commit -am "Prepare snapshot 4.9.3-SNAPSHOT"` 27 | 9. `git push && git push --tags` 28 | 10. Merging PR master will create a snapshot release 4.9.3-SNAPSHOT and tag push will create stable release 4.9.2 -------------------------------------------------------------------------------- /analytics-wear/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /analytics/src/test/java/android/net/http/AndroidHttpClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Segment.io, Inc. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package android.net.http; 25 | 26 | // Workaround for https://github.com/robolectric/robolectric/issues/1862 27 | public class AndroidHttpClient {} 28 | -------------------------------------------------------------------------------- /analytics-tests/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /analytics-samples/analytics-sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 27 | 28 | 16dp 29 | 16dp 30 | 31 | 32 | -------------------------------------------------------------------------------- /analytics/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /analytics-samples/kotlin-sample/src/main/res/layout/activity_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 21 | 22 |