diff --git a/android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyDefaultAttributes.java b/android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyDefaultAttributes.java index 9f3f15ae9..4b1f53ef3 100644 --- a/android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyDefaultAttributes.java +++ b/android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyDefaultAttributes.java @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2016-2021, Optimizely, Inc. and contributors * + * Copyright 2016-2022, Optimizely, Inc. and contributors * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * @@ -74,10 +74,9 @@ static Map buildDefaultAttributesMap(Context context, Logger log Map attrMap = new HashMap<>(); attrMap.put(DEVICE_MODEL_KEY, androidDeviceModel); - attrMap.put(SDK_VERSION_KEY, androidSdkVersionName); + attrMap.put(SDK_VERSION_KEY, androidSdkVersion); attrMap.put(OS_VERSION_KEY, androidOSVersion); - String appVersion = androidAppVersionName + Integer.toString(androidAppVersion); - attrMap.put(APP_VERSION_KEY, appVersion); + attrMap.put(APP_VERSION_KEY, androidAppVersionName); return attrMap; } diff --git a/test-app/build.gradle b/test-app/build.gradle index eab7f69da..71ef929c5 100644 --- a/test-app/build.gradle +++ b/test-app/build.gradle @@ -14,7 +14,7 @@ android { minSdkVersion 14 targetSdkVersion target_sdk_version versionCode 1 - versionName "1.0" + versionName "1.0.2" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } testOptions { @@ -41,20 +41,22 @@ android { dependencies { // Includes the Optimizely X Full Stack Java SDK, event handler, and user profile + //implementation "com.optimizely.ab:android-sdk:1.0.0" implementation (project(':android-sdk')) { exclude group: 'com.google.code.gson', module:'gson' - // exclude group: 'com.noveogroup.android', module:'android-logger' } + // EXAMPLE - replace gson with jackson-databind json parser + implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonversion" + + // SLF4J logger + // https://github.com/noveogroup/android-logger (resources/android-logger.properties) implementation "com.noveogroup.android:android-logger:$android_logger_ver" - // implementation "com.optimizely.ab:android-sdk:1.0.0" - implementation "androidx.appcompat:appcompat:1.2.0" - implementation "com.google.android.material:material:1.2.1" - // EXAMPLE - replace noveogroup android-looger with slf4j-android logger // https://mvnrepository.com/artifact/org.slf4j/slf4j-android //implementation "org.slf4j:slf4j-android:1.7.25" - // EXAMPLE - replace gson with jackson-databind json parser - implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonversion" + + implementation "androidx.appcompat:appcompat:1.2.0" + implementation "com.google.android.material:material:1.2.1" // required by API-16 implementation "com.google.code.gson:gson:$gson_ver" diff --git a/test-app/src/main/resources/android-logger.properties b/test-app/src/main/resources/android-logger.properties index 35bf532d7..6a1f0f004 100644 --- a/test-app/src/main/resources/android-logger.properties +++ b/test-app/src/main/resources/android-logger.properties @@ -19,8 +19,8 @@ # https://github.com/noveogroup/android-logger # Valid logging levels are: VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT -# Default configuration (disabled because it would override tags from the application) -#root=DEBUG:Optly +# Default configuration +root=DEBUG:Optly # Core logger.com.optimizely.ab.Optimizely=DEBUG:Optly.core