diff --git a/adobeMobileLibrary/adobeMobileLibrary-4.13.2.jar b/adobeMobileLibrary/adobeMobileLibrary-4.13.2.jar new file mode 100644 index 0000000..819cf0c Binary files /dev/null and b/adobeMobileLibrary/adobeMobileLibrary-4.13.2.jar differ diff --git a/adobeMobileLibrary/build.gradle b/adobeMobileLibrary/build.gradle new file mode 100644 index 0000000..58dd4bc --- /dev/null +++ b/adobeMobileLibrary/build.gradle @@ -0,0 +1,2 @@ +configurations.maybeCreate("default") +artifacts.add("default", file('adobeMobileLibrary-4.13.2.jar')) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 42f97c8..5502fcc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.1.2-2' + ext.kotlin_version = '1.1.2-4' + ext.kotlin_version = '1.1.2-4' repositories { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.4.0-alpha7' + classpath 'com.android.tools.build:gradle:3.0.0-alpha1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1f3ff61..0a4f74f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue May 02 16:55:48 EDT 2017 +#Wed Jun 14 16:32:12 EDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip diff --git a/sample/build.gradle b/sample/build.gradle index 06387e0..23d4332 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -27,15 +27,17 @@ dependencies { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" - compile 'com.android.support:appcompat-v7:25.3.0' - compile 'com.android.support.constraint:constraint-layout:1.0.2' - compile 'com.android.support:design:25.3.0' - compile 'com.android.support:support-vector-drawable:25.3.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" + implementation 'com.android.support:appcompat-v7:25.3.0' + implementation 'com.android.support.constraint:constraint-layout:1.0.2' + implementation 'com.android.support:design:25.3.0' + implementation 'com.android.support:support-vector-drawable:25.3.0' testCompile 'junit:junit:4.12' - compile project(':simcoe') - compile 'com.jakewharton.timber:timber:4.5.1' + implementation project(':simcoe') + implementation 'com.jakewharton.timber:timber:4.5.1' +// compile project(path: ':simcoe-adobe') + implementation project(':simcoe-adobe') } repositories { mavenCentral() diff --git a/sample/src/main/java/com/prolificinteractive/sample/MainActivity.java b/sample/src/main/java/com/prolificinteractive/sample/MainActivity.java index 3df7b74..4181047 100644 --- a/sample/src/main/java/com/prolificinteractive/sample/MainActivity.java +++ b/sample/src/main/java/com/prolificinteractive/sample/MainActivity.java @@ -4,7 +4,7 @@ import android.os.PersistableBundle; import android.support.v7.app.AppCompatActivity; import android.view.View; -import com.prolificinteractive.simcoe.EmptyProvider; +import com.prolificinteractive.adobe.AdobeProvider; import com.prolificinteractive.simcoe.trackers.AnalyticsTracking; import java.util.HashMap; import java.util.HashSet; @@ -18,8 +18,9 @@ protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Set set = new HashSet<>(); - set.add(new EmptyProvider()); + //set.add(new EmptyProvider()); //set.add(new MParticleAnalyticsProvider()); + set.add(new AdobeProvider("", "sample")); final SampleAnalyticsHelper sampleAnalyticsHelper = new SampleAnalyticsHelper(set); sampleAnalyticsHelper.start(this); diff --git a/settings.gradle b/settings.gradle index cef831b..ffbe99a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,3 @@ -include ':simcoe' +include ':simcoe', ':simcoe-adobe', ':adobeMobileLibrary' include ':simcoe-mixpanel' include ':sample' diff --git a/simcoe-adobe/.gitignore b/simcoe-adobe/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/simcoe-adobe/.gitignore @@ -0,0 +1 @@ +/build diff --git a/simcoe-adobe/build.gradle b/simcoe-adobe/build.gradle new file mode 100644 index 0000000..052624d --- /dev/null +++ b/simcoe-adobe/build.gradle @@ -0,0 +1,30 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + + defaultConfig { + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + + versionCode Integer.parseInt(project.VERSION_CODE) + versionName project.VERSION_NAME + + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation project(':simcoe') + + implementation project(':adobeMobileLibrary') + + testCompile 'junit:junit:4.12' +} diff --git a/simcoe-adobe/proguard-rules.pro b/simcoe-adobe/proguard-rules.pro new file mode 100644 index 0000000..8ab425a --- /dev/null +++ b/simcoe-adobe/proguard-rules.pro @@ -0,0 +1,25 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/ellingtonkirby/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/simcoe-adobe/src/main/AndroidManifest.xml b/simcoe-adobe/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e93355a --- /dev/null +++ b/simcoe-adobe/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/simcoe-adobe/src/main/java/com/prolificinteractive/adobe/AdobeProvider.kt b/simcoe-adobe/src/main/java/com/prolificinteractive/adobe/AdobeProvider.kt new file mode 100644 index 0000000..2a9419b --- /dev/null +++ b/simcoe-adobe/src/main/java/com/prolificinteractive/adobe/AdobeProvider.kt @@ -0,0 +1,70 @@ +package com.prolificinteractive.adobe + +import android.content.Context +import com.adobe.mobile.Analytics +import com.adobe.mobile.AudienceManager +import com.prolificinteractive.simcoe.Properties +import com.prolificinteractive.simcoe.Success +import com.prolificinteractive.simcoe.TrackingResult +import com.prolificinteractive.simcoe.trackers.EventTracking +import com.prolificinteractive.simcoe.trackers.PageViewTracking +import com.prolificinteractive.simcoe.trackers.TimedEventTracking + +/** + * Creates a new adobe analytics provider instance. + */ + +class AdobeProvider(private val token: String ="", private val appName: String) : + EventTracking, PageViewTracking, TimedEventTracking { + override fun startTimedEvent(eventName: String, properties: Properties?): TrackingResult { + Analytics.trackTimedActionStart(eventName, properties) + return Success() + } + + override fun stopTimedEvent(eventName: String, properties: Properties?): TrackingResult { + Analytics.trackTimedActionEnd(eventName, Analytics.TimedActionBlock { l1, l2, map -> + map.putAll(properties as Map) + //needed to return it like this or else it tryed to return out of the whole fun + return@TimedActionBlock true + } + ) + return Success() + } + + companion object { + private val ADOBE_PROVIDER_NAME = "Adobe" + private val APP = "app" + } + + override fun providerName(): String { + return ADOBE_PROVIDER_NAME + } + + override fun start(context: Context) { + val map: Map = HashMap() + map.plus(Pair(APP, appName)) + AudienceManager.signalWithData(map, null) + } + + override fun trackPageView(pageName: String, properties: Properties?): TrackingResult { + Analytics.trackState(pageName, properties) + trackSingleValueWithAudienceManager(pageName, properties) + return Success() + } + + override fun trackEvent(eventName: String, properties: Properties?): TrackingResult { + Analytics.trackAction(eventName, properties) + AudienceManager.signalWithData(properties, null) + return Success() + } + + override fun stop() { + } + + private fun trackSingleValueWithAudienceManager(value: String, properties: Properties?) { + val map: Map = HashMap() + map.plus(Pair(value, properties)) + AudienceManager.signalWithData(map, null) + } + +} \ No newline at end of file diff --git a/simcoe-adobe/src/main/res/values/strings.xml b/simcoe-adobe/src/main/res/values/strings.xml new file mode 100644 index 0000000..833a8b1 --- /dev/null +++ b/simcoe-adobe/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + simcoe-adobe +