diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98ccca4..fca50ca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# Change Log
-
+- 5.7.0
+ - Update Gradle to latest version to fix Proguard issues
+ - Location 1.0.0
+ - Location tracking based on defined geofence
+ - New Event Attributes:
+ - `geofence_name`
+ - `geofence_transition_type`
+ - `location_accuracy`
+ - `device_last_latitude`
+ - `device_last_longitude`
- 5.6.2
- Embed proguard-rules
- All Modules - proguard-rules are now embedded in each module
@@ -20,7 +29,7 @@
- 5.5.5
- Webview bug fix: disable Hardware Acceleration for Tealium webview
- Install Referrer 1.1.2
- - Placement of endconnection() to more appropriate location
+ - Bug fix: resolve referrerClient NPE by adding `endConnection()` after establishing connection
- 5.5.4
- Fixed VisitorProfile URL to default to profile provided in Tealium.Config
- 5.5.3
diff --git a/Modules/Location/.gitignore b/Modules/Location/.gitignore
new file mode 100644
index 0000000..1bcf832
--- /dev/null
+++ b/Modules/Location/.gitignore
@@ -0,0 +1,5 @@
+.idea
+.gradle
+*.iml
+build
+local.properties
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/.gitignore b/Modules/Location/LocationSample/.gitignore
new file mode 100644
index 0000000..2b75303
--- /dev/null
+++ b/Modules/Location/LocationSample/.gitignore
@@ -0,0 +1,13 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/Modules/Location/LocationSample/app/.gitignore b/Modules/Location/LocationSample/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/Modules/Location/LocationSample/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/Modules/Location/LocationSample/app/build.gradle b/Modules/Location/LocationSample/app/build.gradle
new file mode 100644
index 0000000..d549014
--- /dev/null
+++ b/Modules/Location/LocationSample/app/build.gradle
@@ -0,0 +1,40 @@
+apply plugin: 'com.android.application'
+apply plugin: 'com.google.gms.google-services'
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.1"
+ defaultConfig {
+ applicationId "com.example.tealiumlocationdemoapp"
+ minSdkVersion 19
+ targetSdkVersion 29
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation 'androidx.appcompat:appcompat:1.0.2'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+
+ // Tealium dependencies
+ implementation 'com.tealium:library:5.7.0'
+ implementation 'com.tealium:location:1.0.0'
+
+ // Other required dependencies
+ runtimeOnly 'com.google.android.gms:play-services-location:17.0.0'
+ implementation 'com.google.firebase:firebase-messaging:20.0.0'
+ implementation 'com.optimizely.ab:android-sdk:2.1.0'
+
+ // Testing dependencies
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test:runner:1.2.0'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+}
diff --git a/Modules/Location/LocationSample/app/google-services.json b/Modules/Location/LocationSample/app/google-services.json
new file mode 100644
index 0000000..fb49f8d
--- /dev/null
+++ b/Modules/Location/LocationSample/app/google-services.json
@@ -0,0 +1,3 @@
+{
+ "_comment": "INSERT YOUR GOOGLE-SERVICES.JSON CONFIGURATION HERE"
+}
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/proguard-rules.pro b/Modules/Location/LocationSample/app/proguard-rules.pro
new file mode 100644
index 0000000..6299c0b
--- /dev/null
+++ b/Modules/Location/LocationSample/app/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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
+
+-keep com.tealium.internal.** {
+ *;
+}
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/AndroidManifest.xml b/Modules/Location/LocationSample/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..71393a7
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/AndroidManifest.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/Assets/geofences.json b/Modules/Location/LocationSample/app/src/main/Assets/geofences.json
new file mode 100644
index 0000000..98c9519
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/Assets/geofences.json
@@ -0,0 +1,22 @@
+[
+ {
+ "name": "Tealium_asset1",
+ "latitude": 59.4610304,
+ "longitude": -9.9707625,
+ "radius": 100,
+ "expire_after": -1,
+ "trigger_on_enter": true,
+ "trigger_on_exit": true,
+ "minimum_dwell_time": 0
+ },
+ {
+ "name": "Tealium_asset2",
+ "latitude": 39.9061189,
+ "longitude": -142.2379163,
+ "radius": 100,
+ "expire_after": -1,
+ "trigger_on_enter": true,
+ "trigger_on_exit": true,
+ "minimum_dwell_time": 0
+ }
+]
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/App.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/App.java
new file mode 100644
index 0000000..1a4c568
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/App.java
@@ -0,0 +1,11 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.app.Application;
+
+public class App extends Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ TealiumHelper.initialize(this);
+ }
+}
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationAssets.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationAssets.java
new file mode 100644
index 0000000..0f592ba
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationAssets.java
@@ -0,0 +1,102 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.tealium.location.TealiumLocation;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class LocationAssets extends Activity {
+
+ private boolean mLocationShowcaseStarted = false;
+ private TealiumLocation mInstance;
+ private final String mGeofenceJsonFile = "geofences.json";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_assets);
+
+ findViewById(R.id.location_assets_button_update)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mLocationShowcaseStarted) {
+ drawActiveGeofences();
+ drawUsedAssets();
+ } else {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_assets_button_start)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ startLocationShowcase();
+ } else {
+ showToast("Showcase Already Started!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_assets_button_stop).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+ }
+
+ private void startLocationShowcase() {
+ mLocationShowcaseStarted = true;
+
+ Set tealiumInstances = new HashSet<>();
+ tealiumInstances.add(TealiumHelper.TEALIUM_MAIN);
+
+ mInstance = TealiumLocation.setupInstanceWithFile(this, tealiumInstances, mGeofenceJsonFile);
+ mInstance.startLocationUpdates(true, 5000);
+ drawUsedAssets();
+ drawActiveGeofences();
+ }
+
+ private void drawActiveGeofences() {
+ List activeGeofences = mInstance.getAllGeofenceNames();
+ String geofenceNames = "";
+
+ for (String name : activeGeofences) {
+ geofenceNames = geofenceNames + name + "\n";
+ }
+
+ TextView geofenceNameData = findViewById(R.id.location_assets_geofencesdata);
+ geofenceNameData.setText(geofenceNames);
+ }
+
+ private void drawUsedAssets() {
+ TextView urlData = findViewById(R.id.location_assets_assetsdata);
+ urlData.setText(mGeofenceJsonFile);
+ }
+
+ private void showToast(String message) {
+ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (mLocationShowcaseStarted) {
+ TealiumLocation.destroyInstance();
+ }
+ }
+}
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationConfig.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationConfig.java
new file mode 100644
index 0000000..22ad52d
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationConfig.java
@@ -0,0 +1,110 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.tealium.library.Tealium;
+import com.tealium.location.TealiumLocation;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class LocationConfig extends Activity {
+
+ private Tealium.Config mTealiumConfig;
+ private boolean mLocationShowcaseStarted = false;
+ private TealiumLocation mInstance;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_config);
+
+ findViewById(R.id.location_config_button_update)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mLocationShowcaseStarted) {
+ drawActiveGeofences();
+ drawUsedConfig();
+ } else {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_config_button_start)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ startLocationShowcase();
+ } else {
+ showToast("Showcase Already Started!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_config_button_stop)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+ }
+
+ private void startLocationShowcase() {
+ mLocationShowcaseStarted = true;
+
+ mTealiumConfig = TealiumHelper.getConfig();
+
+ Set tealiumInstances = new HashSet<>();
+ tealiumInstances.add(TealiumHelper.TEALIUM_MAIN);
+
+ if (mTealiumConfig != null) {
+ mInstance = TealiumLocation.setupInstanceWithConfig(this, tealiumInstances, mTealiumConfig);
+ mInstance.startLocationUpdates(true, 5000);
+ drawActiveGeofences();
+ drawUsedConfig();
+ } else {
+ showToast("Error with config");
+ }
+ }
+
+ private void drawActiveGeofences() {
+ List activeGeofences = mInstance.getAllGeofenceNames();
+ String geofenceNames = "";
+
+ for (String name : activeGeofences) {
+ geofenceNames = geofenceNames + name + "\n";
+ }
+
+ TextView geofenceNameData = findViewById(R.id.location_config_geofencesdata);
+ geofenceNameData.setText(geofenceNames);
+ }
+
+ private void drawUsedConfig() {
+ TextView urlData = findViewById(R.id.location_config_configdata);
+ urlData.setText(mTealiumConfig.getAccountName());
+ }
+
+ private void showToast(String message) {
+ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (mLocationShowcaseStarted) {
+ TealiumLocation.destroyInstance();
+ }
+ }
+}
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationGeofencing.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationGeofencing.java
new file mode 100644
index 0000000..2ec8c9d
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationGeofencing.java
@@ -0,0 +1,115 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.app.Activity;
+import android.location.Location;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.tealium.location.TealiumLocation;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class LocationGeofencing extends Activity {
+
+ private boolean mLocationShowcaseStarted = false;
+ private Location mLastLocation;
+ private TealiumLocation mInstance;
+ private static final String GEOFENCES_URL = "https://tags.tiqcdn.com/dle/tealiummobile/location/geofences.json";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_geofencing);
+
+ findViewById(R.id.location_geofencing_button_update)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mLocationShowcaseStarted) {
+ mLastLocation = mInstance.getLastLocation();
+ drawLastLocation();
+ drawActiveGeofences();
+ } else {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_geofencing_button_start)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ startLocationShowcase();
+ } else {
+ showToast("Showcase Already Started!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_geofencing_button_stop)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mLocationShowcaseStarted) {
+ mInstance.stopLocationUpdates();
+ showToast("Showcase Stopped.");
+ } else {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+ }
+
+ private void startLocationShowcase() {
+ mLocationShowcaseStarted = true;
+
+ Set tealiumInstances = new HashSet<>();
+ tealiumInstances.add(TealiumHelper.TEALIUM_MAIN);
+
+ mInstance = TealiumLocation.setupInstanceWithUrl(this, tealiumInstances, GEOFENCES_URL);
+ mInstance.startLocationUpdates(true, 5000);
+ drawLastLocation();
+ drawActiveGeofences();
+ }
+
+ private void drawLastLocation() {
+ TextView locationData = findViewById(R.id.location_geofencing_locationdata);
+
+ if (mLastLocation != null) {
+ locationData.setText("Latitude: " + mLastLocation.getLatitude() + "\nLongitude: " + mLastLocation.getLongitude());
+ } else {
+ locationData.setText("Please Update UI");
+ Toast.makeText(getApplicationContext(), "Location Updates Every 5 Seconds, Please wait a bit!", Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ private void drawActiveGeofences() {
+ List activeGeofences = mInstance.getActiveGeofenceNames();
+ String geofenceNames = "";
+
+ for (String geofence : activeGeofences) {
+ geofenceNames = geofenceNames + geofence + "\n";
+ }
+
+ TextView geofenceNameData = findViewById(R.id.location_geofencing_geofencesdata);
+ geofenceNameData.setText(geofenceNames);
+ }
+
+ private void showToast(String message) {
+ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (mLocationShowcaseStarted) {
+ TealiumLocation.destroyInstance();
+ }
+ }
+}
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationTracking.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationTracking.java
new file mode 100644
index 0000000..daf296b
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationTracking.java
@@ -0,0 +1,90 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.app.Activity;
+import android.location.Location;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.tealium.location.TealiumLocation;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class LocationTracking extends Activity {
+
+ private boolean mLocationShowcaseStarted = false;
+ private Location mLastLocation;
+ private TealiumLocation mInstance;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_location);
+
+ findViewById(R.id.location_tracking_button_update)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mLocationShowcaseStarted) {
+ mLastLocation = mInstance.getLastLocation();
+ drawLastLocation();
+ } else {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_tracking_button_start)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ startLocationShowcase();
+ } else {
+ showToast("Showcase Already Started!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_tracking_button_stop)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mLocationShowcaseStarted) {
+ mInstance.stopLocationUpdates();
+ showToast("Showcase Stopped.");
+ } else {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+ }
+
+ private void startLocationShowcase() {
+ mLocationShowcaseStarted = true;
+
+ Set tealiumInstances = new HashSet<>();
+ tealiumInstances.add(TealiumHelper.TEALIUM_MAIN);
+
+ mInstance = TealiumLocation.setupInstance(this, tealiumInstances);
+ mInstance.startLocationUpdates(true, 5000);
+ drawLastLocation();
+ }
+
+ private void drawLastLocation() {
+ TextView locationData = findViewById(R.id.location_tracking_locationdata);
+
+ if (mLastLocation != null) {
+ locationData.setText("Latitude: " + mLastLocation.getLatitude() + "\nLongitude: " + mLastLocation.getLongitude());
+ } else {
+ locationData.setText("Please Update UI");
+ showToast("Location Updates Every 5 Seconds, Please wait a bit!");
+ }
+ }
+
+ private void showToast(String message) {
+ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
+ }
+}
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationUrl.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationUrl.java
new file mode 100644
index 0000000..3f93579
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/LocationUrl.java
@@ -0,0 +1,105 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.tealium.location.TealiumLocation;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class LocationUrl extends Activity {
+
+ private boolean mLocationShowcaseStarted = false;
+ private TealiumLocation mInstance;
+ private final String mGeofenceJsonUrl = "https://tags.tiqcdn.com/dle/tealiummobile/location/geofences.json";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_url);
+
+ findViewById(R.id.location_url_button_update)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mLocationShowcaseStarted) {
+ drawActiveGeofences();
+ drawUsedUrl();
+ } else {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_url_button_start)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ startLocationShowcase();
+ } else {
+ showToast("Showcase Already Started!");
+ }
+ }
+ });
+
+ findViewById(R.id.location_url_button_stop)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (!mLocationShowcaseStarted) {
+ showToast("Please press Start first!");
+ }
+ }
+ });
+ }
+
+ private void startLocationShowcase() {
+ mLocationShowcaseStarted = true;
+
+ Set tealiumInstances = new HashSet<>();
+ tealiumInstances.add(TealiumHelper.TEALIUM_MAIN);
+
+ mInstance = TealiumLocation.setupInstanceWithUrl(this, tealiumInstances, mGeofenceJsonUrl);
+ mInstance.startLocationUpdates(true, 5000);
+ drawActiveGeofences();
+ drawUsedUrl();
+ }
+
+ private void drawActiveGeofences() {
+ List activeGeofences = mInstance.getAllGeofenceNames();
+ String geofenceNames = "";
+
+ for (String name : activeGeofences) {
+ geofenceNames = geofenceNames + name + "\n";
+ }
+
+ TextView geofenceNameData = findViewById(R.id.location_url_geofencesdata);
+ geofenceNameData.setText(geofenceNames);
+ }
+
+ private void drawUsedUrl() {
+ TextView urlData = findViewById(R.id.location_url_urldata);
+ urlData.setText(mGeofenceJsonUrl);
+ }
+
+ private void showToast(String message) {
+ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (mLocationShowcaseStarted) {
+ TealiumLocation.destroyInstance();
+ }
+ }
+}
+
+
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/MainActivity.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/MainActivity.java
new file mode 100644
index 0000000..87db7b6
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/MainActivity.java
@@ -0,0 +1,97 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.Manifest;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+
+public class MainActivity extends AppCompatActivity {
+
+ public static final int LOCATION_REQUEST_CODE = 101;
+ private static final String TAG = "MainActivity";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ if ((ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION)
+ != PackageManager.PERMISSION_GRANTED) && ContextCompat.checkSelfPermission(getApplicationContext(),
+ Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+ requestLocationPermission();
+ }
+
+ findViewById(R.id.main_button_url_demo)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(v.getContext(), LocationUrl.class));
+ }
+ });
+
+ findViewById(R.id.main_button_assets_demo)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(v.getContext(), LocationAssets.class));
+ }
+ });
+
+ findViewById(R.id.main_button_config_demo)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(v.getContext(), LocationConfig.class));
+ }
+ });
+
+ findViewById(R.id.main_button_location_demo)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(v.getContext(), LocationTracking.class));
+ }
+ });
+
+ findViewById(R.id.main_button_geofencing_demo)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(v.getContext(), LocationGeofencing.class));
+ }
+ });
+ }
+
+ public void requestLocationPermission() {
+ if (ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+ ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, LOCATION_REQUEST_CODE);
+ }
+ }
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ String message;
+ if (requestCode == LOCATION_REQUEST_CODE) {
+ // If request is cancelled, the result arrays are empty.
+ if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
+ message = "Location Permission Granted";
+ } else {
+ message = "Location Permission Not Granted";
+ }
+ } else {
+ message = "Location Permission Not Granted";
+ }
+ showToast(message);
+ }
+
+ private void showToast(String message) {
+ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
+ }
+
+}
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/TealiumFirebaseMessagingService.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/TealiumFirebaseMessagingService.java
new file mode 100644
index 0000000..1a4d9d6
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/TealiumFirebaseMessagingService.java
@@ -0,0 +1,36 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.util.Log;
+
+import com.google.firebase.messaging.FirebaseMessagingService;
+import com.google.firebase.messaging.RemoteMessage;
+
+public class TealiumFirebaseMessagingService extends FirebaseMessagingService {
+
+ public static final String TAG = "TealiumFirebaseMsgSvc";
+
+ public TealiumFirebaseMessagingService() {
+ }
+
+ @Override
+ public void onMessageReceived(RemoteMessage remoteMessage) {
+ Log.d(TAG, "From: " + remoteMessage.getFrom());
+
+ if (remoteMessage.getNotification() != null) {
+ Log.d(TAG, "Message Notification Title: " + remoteMessage.getNotification().getTitle());
+ Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
+ }
+ }
+
+ /**
+ * Called if InstanceID token is updated. This may occur if the security of
+ * the previous token had been compromised. Note that this is called when the InstanceID token
+ * is initially generated so this is where you would retrieve the token.
+ */
+ @Override
+ public void onNewToken(String token) {
+ Log.d(TAG, "Refreshed token: " + token);
+
+ TealiumHelper.updatePushToken(token);
+ }
+}
diff --git a/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/TealiumHelper.java b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/TealiumHelper.java
new file mode 100644
index 0000000..d957699
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/java/com/example/tealiumlocationdemoapp/TealiumHelper.java
@@ -0,0 +1,168 @@
+package com.example.tealiumlocationdemoapp;
+
+import android.app.Application;
+import android.content.SharedPreferences;
+import android.util.Log;
+import android.webkit.WebView;
+
+import com.tealium.internal.data.Dispatch;
+import com.tealium.internal.listeners.WebViewLoadedListener;
+import com.tealium.internal.tagbridge.RemoteCommand;
+import com.tealium.library.DispatchValidator;
+import com.tealium.library.Tealium;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * This class abstracts interaction with the Tealium library and simplifies comprehension
+ */
+public final class TealiumHelper {
+
+ static {
+ Log.i("TagBridge", " --- START --- ");
+ }
+
+ private final static String KEY_TEALIUM_INIT_COUNT = "tealium_init_count";
+ private final static String KEY_TEALIUM_INITIALIZED = "tealium_initialized";
+ private final static String TAG = "TealiumHelper";
+ private static Tealium.Config sConfig;
+
+ // Identifier for the main Tealium instance
+ public static final String TEALIUM_MAIN = "main";
+
+ // Not instantiatable.
+ private TealiumHelper() {
+ }
+
+ public static void initialize(Application application) {
+
+ Log.i(TAG, "initialize(" + application.getClass().getSimpleName() + ")");
+
+ WebView.setWebContentsDebuggingEnabled(true);
+
+ final Tealium.Config config = Tealium.Config.create(application, "tealiummobile", "location", "dev");
+
+ // (OPTIONAL) Update console logs verbosity
+ config.setForceOverrideLogLevel("dev");
+
+ // (OPTIONAL) Get the WebView with UTag loaded
+ config.getEventListeners().add(createWebViewLoadedListener());
+
+ // (OPTIONAL) Control how the library treats views/links
+ config.getDispatchValidators().add(createDispatchValidator());
+
+ sConfig = config;
+
+ final Tealium instance = Tealium.createInstance(TEALIUM_MAIN, sConfig);
+
+ // (OPTIONAL) Enhanced integrations
+ instance.addRemoteCommand(createLoggerRemoteCommand());
+
+ // (OPTIONAL) Use tealium.getDataSources().getPersistentDataSources() to set/modify lifetime values
+ SharedPreferences sp = instance.getDataSources().getPersistentDataSources();
+ sp.edit().putInt(KEY_TEALIUM_INIT_COUNT, sp.getInt(KEY_TEALIUM_INIT_COUNT, 0) + 1).commit();
+
+ // (OPTIONAL) Use tealium.getDataSources().getVolatileDataSources() to set/modify runtime only values
+ instance.getDataSources().getVolatileDataSources()
+ .put(KEY_TEALIUM_INITIALIZED, System.currentTimeMillis());
+
+ // (OPTIONAL) tracking initialization
+ final Map data = new HashMap<>(2);
+ data.put("logged_in", false);
+ data.put("visitor_status", new String[]{"new_user", "unregistered"});
+ TealiumHelper.trackEvent("initialization", data);
+ }
+
+ public static void trackView(String viewName, Map data) {
+ final Tealium instance = Tealium.getInstance(TEALIUM_MAIN);
+
+ // Instance can be remotely destroyed through publish settings
+ if (instance != null) {
+ instance.trackView(viewName, data);
+ }
+ }
+
+ public static void trackEvent(String eventName, Map data) {
+ final Tealium instance = Tealium.getInstance(TEALIUM_MAIN);
+
+ // Instance can be remotely destroyed through publish settings
+ if (instance != null) {
+ instance.trackEvent(eventName, data);
+ }
+ }
+
+ private static WebViewLoadedListener createWebViewLoadedListener() {
+ return new WebViewLoadedListener() {
+ @Override
+ public void onWebViewLoad(WebView webView, boolean success) {
+ Log.d(TAG, "WebView " + webView +
+ (success ? " loaded successfully" : "failed to load"));
+ }
+
+ @Override
+ public String toString() {
+ return "LoggingWebViewLoadListener";
+ }
+ };
+ }
+
+ private static DispatchValidator createDispatchValidator() {
+ return new DispatchValidator() {
+ @Override
+ protected boolean shouldDrop(Dispatch dispatch) {
+
+ // Drop any desired dispatches here by returning true. (Never queued nor sent)
+ return super.shouldDrop(dispatch);
+ }
+
+ @Override
+ protected boolean shouldQueue(Dispatch dispatch, boolean shouldQueue) {
+
+ Log.d(TAG, String.format(
+ Locale.ROOT,
+ "%s dispatch: %s",
+ (shouldQueue ? "Queueing" : "Sending"),
+ dispatch));
+
+ return super.shouldQueue(dispatch, shouldQueue);
+ }
+
+ @Override
+ public String toString() {
+ return "CustomDispatchValidator";
+ }
+ };
+ }
+
+ private static RemoteCommand createLoggerRemoteCommand() {
+ return new RemoteCommand("logger", "Logs dispatches") {
+ @Override
+ protected void onInvoke(Response response) throws Exception {
+ final String message = response.getRequestPayload()
+ .optString("message", "no_message");
+ Log.i(TAG, "RemoteCommand Message: " + message);
+ }
+
+ @Override
+ public String toString() {
+ return "LoggerRemoteCommand";
+ }
+ };
+ }
+
+ public static Tealium.Config getConfig() {
+ return sConfig;
+ }
+
+ public static void updatePushToken(String token) {
+
+ if (Tealium.getInstance(TealiumHelper.TEALIUM_MAIN) == null || token == null) {
+ return;
+ }
+
+ Tealium.getInstance(TealiumHelper.TEALIUM_MAIN).getDataSources().getPersistentDataSources().edit().putString("push_token", token).apply();
+ }
+
+}
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Modules/Location/LocationSample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..1f6bb29
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Modules/Location/LocationSample/app/src/main/res/drawable/ic_launcher_background.xml b/Modules/Location/LocationSample/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..0d025f9
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Modules/Location/LocationSample/app/src/main/res/drawable/tealium_logo_rgb_600x278px.png b/Modules/Location/LocationSample/app/src/main/res/drawable/tealium_logo_rgb_600x278px.png
new file mode 100644
index 0000000..b26670d
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/drawable/tealium_logo_rgb_600x278px.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/drawable/tealium_logo_white_rgb_600x278px.png b/Modules/Location/LocationSample/app/src/main/res/drawable/tealium_logo_white_rgb_600x278px.png
new file mode 100644
index 0000000..2346da5
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/drawable/tealium_logo_white_rgb_600x278px.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/layout/activity_assets.xml b/Modules/Location/LocationSample/app/src/main/res/layout/activity_assets.xml
new file mode 100644
index 0000000..87eb026
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/layout/activity_assets.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/layout/activity_config.xml b/Modules/Location/LocationSample/app/src/main/res/layout/activity_config.xml
new file mode 100644
index 0000000..6f1b65f
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/layout/activity_config.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/layout/activity_geofencing.xml b/Modules/Location/LocationSample/app/src/main/res/layout/activity_geofencing.xml
new file mode 100644
index 0000000..9587e45
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/layout/activity_geofencing.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/layout/activity_location.xml b/Modules/Location/LocationSample/app/src/main/res/layout/activity_location.xml
new file mode 100644
index 0000000..a6e21cb
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/layout/activity_location.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/layout/activity_main.xml b/Modules/Location/LocationSample/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..d784be0
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/layout/activity_url.xml b/Modules/Location/LocationSample/app/src/main/res/layout/activity_url.xml
new file mode 100644
index 0000000..3495db5
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/layout/activity_url.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Modules/Location/LocationSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Modules/Location/LocationSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..898f3ed
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dffca36
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..64ba76f
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dae5e08
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..e5ed465
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..14ed0af
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b0907ca
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..d8ae031
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..2c18de9
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..beed3cd
Binary files /dev/null and b/Modules/Location/LocationSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/Modules/Location/LocationSample/app/src/main/res/values/colors.xml b/Modules/Location/LocationSample/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..232f084
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #008577
+ #00574B
+ #0B83F3
+
diff --git a/Modules/Location/LocationSample/app/src/main/res/values/strings.xml b/Modules/Location/LocationSample/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..0fb52d7
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ TealiumLocationDemoApp
+
diff --git a/Modules/Location/LocationSample/app/src/main/res/values/styles.xml b/Modules/Location/LocationSample/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..0eb88fe
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/Modules/Location/LocationSample/app/src/main/res/xml/network_security_config.xml b/Modules/Location/LocationSample/app/src/main/res/xml/network_security_config.xml
new file mode 100644
index 0000000..02ecb34
--- /dev/null
+++ b/Modules/Location/LocationSample/app/src/main/res/xml/network_security_config.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Modules/Location/LocationSample/build.gradle b/Modules/Location/LocationSample/build.gradle
new file mode 100644
index 0000000..7b67281
--- /dev/null
+++ b/Modules/Location/LocationSample/build.gradle
@@ -0,0 +1,31 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.4.2'
+ classpath 'com.google.gms:google-services:4.3.1'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ google()
+ mavenCentral()
+ maven {
+ url "https://maven.tealiumiq.com/android/releases/"
+
+ }
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/Modules/Location/LocationSample/gradle.properties b/Modules/Location/LocationSample/gradle.properties
new file mode 100644
index 0000000..199d16e
--- /dev/null
+++ b/Modules/Location/LocationSample/gradle.properties
@@ -0,0 +1,20 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+
diff --git a/Modules/Location/LocationSample/gradle/wrapper/gradle-wrapper.jar b/Modules/Location/LocationSample/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/Modules/Location/LocationSample/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Modules/Location/LocationSample/gradle/wrapper/gradle-wrapper.properties b/Modules/Location/LocationSample/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..702e14b
--- /dev/null
+++ b/Modules/Location/LocationSample/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Aug 27 11:26:48 BST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
diff --git a/Modules/Location/LocationSample/gradlew b/Modules/Location/LocationSample/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/Modules/Location/LocationSample/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/Modules/Location/LocationSample/gradlew.bat b/Modules/Location/LocationSample/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/Modules/Location/LocationSample/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Modules/Location/LocationSample/settings.gradle b/Modules/Location/LocationSample/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/Modules/Location/LocationSample/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/Modules/Location/README.md b/Modules/Location/README.md
new file mode 100644
index 0000000..1d70eca
--- /dev/null
+++ b/Modules/Location/README.md
@@ -0,0 +1,4 @@
+# Tealium Location Module (Android)
+
+## Documentation
+Please see [Tealium Learning Community Article](https://docs.tealium.com/platforms/android-java/module-list/location/)
\ No newline at end of file
diff --git a/Modules/Location/tealium.location-1.0.0.aar b/Modules/Location/tealium.location-1.0.0.aar
new file mode 100644
index 0000000..1a4526c
Binary files /dev/null and b/Modules/Location/tealium.location-1.0.0.aar differ
diff --git a/Samples/AndroidTVSample/.gitignore b/Samples/AndroidTVSample/.gitignore
index 152ca16..1bcf832 100644
--- a/Samples/AndroidTVSample/.gitignore
+++ b/Samples/AndroidTVSample/.gitignore
@@ -1,221 +1,5 @@
-
-# Created by https://www.gitignore.io/api/java,android,androidstudio
-# Edit at https://www.gitignore.io/?templates=java,android,androidstudio
-
-### Android ###
-# Built application files
-*.apk
-*.ap_
-*.aab
-
-# Files for the ART/Dalvik VM
-*.dex
-
-# Java class files
-*.class
-
-# Generated files
-bin/
-gen/
-out/
-release/
-
-# Gradle files
-.gradle/
-build/
-
-# Local configuration file (sdk path, etc)
-local.properties
-
-# Proguard folder generated by Eclipse
-proguard/
-
-# Log Files
-*.log
-
-# Android Studio Navigation editor temp files
-.navigation/
-
-# Android Studio captures folder
-captures/
-
-# IntelliJ
-*.iml
-.idea/
-.idea/workspace.xml
-.idea/tasks.xml
-.idea/gradle.xml
-.idea/assetWizardSettings.xml
-.idea/dictionaries
-.idea/libraries
-# Android Studio 3 in .gitignore file.
-.idea/caches
-.idea/modules.xml
-# Comment next line if keeping position of elements in Navigation Editor is relevant for you
-.idea/navEditor.xml
-
-# Keystore files
-# Uncomment the following lines if you do not want to check your keystore files in.
-#*.jks
-#*.keystore
-
-# External native build folder generated in Android Studio 2.2 and later
-.externalNativeBuild
-
-# Google Services (e.g. APIs or Firebase)
-# google-services.json
-
-# Freeline
-freeline.py
-freeline/
-freeline_project_description.json
-
-# fastlane
-fastlane/report.xml
-fastlane/Preview.html
-fastlane/screenshots
-fastlane/test_output
-fastlane/readme.md
-
-# Version control
-vcs.xml
-
-# lint
-lint/intermediates/
-lint/generated/
-lint/outputs/
-lint/tmp/
-# lint/reports/
-
-### Android Patch ###
-gen-external-apklibs
-output.json
-
-### Java ###
-# Compiled class file
-
-# Log file
-
-# BlueJ files
-*.ctxt
-
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
-
-# Package Files #
-*.jar
-*.war
-*.nar
-*.ear
-*.zip
-*.tar.gz
-*.rar
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-
-### AndroidStudio ###
-# Covers files to be ignored for android development using Android Studio.
-
-# Built application files
-
-# Files for the ART/Dalvik VM
-
-# Java class files
-
-# Generated files
-
-# Gradle files
+.idea
.gradle
-
-# Signing files
-.signing/
-
-# Local configuration file (sdk path, etc)
-
-# Proguard folder generated by Eclipse
-
-# Log Files
-
-# Android Studio
-/*/build/
-/*/local.properties
-/*/out
-/*/*/build
-/*/*/production
-*.ipr
-*~
-*.swp
-
-# Android Patch
-
-# External native build folder generated in Android Studio 2.2 and later
-
-# NDK
-obj/
-
-# IntelliJ IDEA
-*.iws
-/out/
-
-# User-specific configurations
-.idea/caches/
-.idea/libraries/
-.idea/shelf/
-.idea/.name
-.idea/compiler.xml
-.idea/copyright/profiles_settings.xml
-.idea/encodings.xml
-.idea/misc.xml
-.idea/scopes/scope_settings.xml
-.idea/vcs.xml
-.idea/jsLibraryMappings.xml
-.idea/datasources.xml
-.idea/dataSources.ids
-.idea/sqlDataSources.xml
-.idea/dynamic.xml
-.idea/uiDesigner.xml
-
-# OS-specific files
-.DS_Store
-.DS_Store?
-._*
-.Spotlight-V100
-.Trashes
-ehthumbs.db
-Thumbs.db
-
-# Legacy Eclipse project files
-.classpath
-.project
-.cproject
-.settings/
-
-# Mobile Tools for Java (J2ME)
-
-# Package Files #
-
-# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
-
-## Plugin-specific files:
-
-# mpeltonen/sbt-idea plugin
-.idea_modules/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Mongo Explorer plugin
-.idea/mongoSettings.xml
-
-# Crashlytics plugin (for Android Studio and IntelliJ)
-com_crashlytics_export_strings.xml
-crashlytics.properties
-crashlytics-build.properties
-fabric.properties
-
-### AndroidStudio Patch ###
-
-!/gradle/wrapper/gradle-wrapper.jar
-
-# End of https://www.gitignore.io/api/java,android,androidstudio
\ No newline at end of file
+*.iml
+build
+local.properties
\ No newline at end of file
diff --git a/Samples/AndroidTVSample/app/build.gradle b/Samples/AndroidTVSample/app/build.gradle
index 6ec3232..47ff420 100644
--- a/Samples/AndroidTVSample/app/build.gradle
+++ b/Samples/AndroidTVSample/app/build.gradle
@@ -22,6 +22,6 @@ dependencies {
implementation 'androidx.leanback:leanback:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
- implementation 'com.tealium:library:5.6.2'
+ implementation 'com.tealium:library:5.7.0'
implementation 'com.tealium:lifecycle:1.1.3'
}
diff --git a/Samples/BlankApp+Tealium/app/build.gradle b/Samples/BlankApp+Tealium/app/build.gradle
index 493901b..65d4409 100644
--- a/Samples/BlankApp+Tealium/app/build.gradle
+++ b/Samples/BlankApp+Tealium/app/build.gradle
@@ -19,5 +19,5 @@ android {
}
dependencies {
- implementation 'com.tealium:library:5.6.2'
+ implementation 'com.tealium:library:5.7.0'
}
diff --git a/Samples/ConsentManagerDemoApp/.gitignore b/Samples/ConsentManagerDemoApp/.gitignore
index b946990..c64b127 100644
--- a/Samples/ConsentManagerDemoApp/.gitignore
+++ b/Samples/ConsentManagerDemoApp/.gitignore
@@ -1,4 +1,4 @@
-.idea/
+.idea/*
.gradle
*.iml
build
diff --git a/Samples/ConsentManagerDemoApp/.idea/caches/build_file_checksums.ser b/Samples/ConsentManagerDemoApp/.idea/caches/build_file_checksums.ser
deleted file mode 100644
index 4343612..0000000
Binary files a/Samples/ConsentManagerDemoApp/.idea/caches/build_file_checksums.ser and /dev/null differ
diff --git a/Samples/ConsentManagerDemoApp/.idea/gradle.xml b/Samples/ConsentManagerDemoApp/.idea/gradle.xml
deleted file mode 100644
index ee635a3..0000000
--- a/Samples/ConsentManagerDemoApp/.idea/gradle.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Samples/ConsentManagerDemoApp/.idea/misc.xml b/Samples/ConsentManagerDemoApp/.idea/misc.xml
deleted file mode 100644
index 64a67ca..0000000
--- a/Samples/ConsentManagerDemoApp/.idea/misc.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Samples/ConsentManagerDemoApp/.idea/runConfigurations.xml b/Samples/ConsentManagerDemoApp/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460..0000000
--- a/Samples/ConsentManagerDemoApp/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Samples/ConsentManagerDemoApp/app/build.gradle b/Samples/ConsentManagerDemoApp/app/build.gradle
index 0de27f2..7b26e91 100644
--- a/Samples/ConsentManagerDemoApp/app/build.gradle
+++ b/Samples/ConsentManagerDemoApp/app/build.gradle
@@ -27,5 +27,5 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
- implementation 'com.tealium:library:5.6.2'
+ implementation 'com.tealium:library:5.7.0'
}
diff --git a/Samples/ExampleApp+Tealium/app/build.gradle b/Samples/ExampleApp+Tealium/app/build.gradle
index 5848f7b..51b7c26 100644
--- a/Samples/ExampleApp+Tealium/app/build.gradle
+++ b/Samples/ExampleApp+Tealium/app/build.gradle
@@ -20,5 +20,5 @@ android {
dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
- implementation 'com.tealium:library:5.6.2'
+ implementation 'com.tealium:library:5.7.0'
}
diff --git a/tealium-5.6.2.aar b/tealium-5.6.2.aar
deleted file mode 100644
index 546a181..0000000
Binary files a/tealium-5.6.2.aar and /dev/null differ
diff --git a/tealium-5.7.0.aar b/tealium-5.7.0.aar
new file mode 100644
index 0000000..3d63c6d
Binary files /dev/null and b/tealium-5.7.0.aar differ