Skip to content

Commit 97168d1

Browse files
authored
fix: change default attributes to more meaningful values (#415)
1 parent ff2ed95 commit 97168d1

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyDefaultAttributes.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* Copyright 2016-2021, Optimizely, Inc. and contributors *
2+
* Copyright 2016-2022, Optimizely, Inc. and contributors *
33
* *
44
* Licensed under the Apache License, Version 2.0 (the "License"); *
55
* you may not use this file except in compliance with the License. *
@@ -74,10 +74,9 @@ static Map<String, String> buildDefaultAttributesMap(Context context, Logger log
7474
Map<String, String> attrMap = new HashMap<>();
7575

7676
attrMap.put(DEVICE_MODEL_KEY, androidDeviceModel);
77-
attrMap.put(SDK_VERSION_KEY, androidSdkVersionName);
77+
attrMap.put(SDK_VERSION_KEY, androidSdkVersion);
7878
attrMap.put(OS_VERSION_KEY, androidOSVersion);
79-
String appVersion = androidAppVersionName + Integer.toString(androidAppVersion);
80-
attrMap.put(APP_VERSION_KEY, appVersion);
79+
attrMap.put(APP_VERSION_KEY, androidAppVersionName);
8180

8281
return attrMap;
8382
}

test-app/build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ android {
1414
minSdkVersion 14
1515
targetSdkVersion target_sdk_version
1616
versionCode 1
17-
versionName "1.0"
17+
versionName "1.0.2"
1818
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1919
}
2020
testOptions {
@@ -41,20 +41,22 @@ android {
4141

4242
dependencies {
4343
// Includes the Optimizely X Full Stack Java SDK, event handler, and user profile
44+
//implementation "com.optimizely.ab:android-sdk:1.0.0"
4445
implementation (project(':android-sdk')) {
4546
exclude group: 'com.google.code.gson', module:'gson'
46-
// exclude group: 'com.noveogroup.android', module:'android-logger'
4747
}
4848

49+
// EXAMPLE - replace gson with jackson-databind json parser
50+
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
51+
52+
// SLF4J logger
53+
// https://github.com/noveogroup/android-logger (resources/android-logger.properties)
4954
implementation "com.noveogroup.android:android-logger:$android_logger_ver"
50-
// implementation "com.optimizely.ab:android-sdk:1.0.0"
51-
implementation "androidx.appcompat:appcompat:1.2.0"
52-
implementation "com.google.android.material:material:1.2.1"
53-
// EXAMPLE - replace noveogroup android-looger with slf4j-android logger
5455
// https://mvnrepository.com/artifact/org.slf4j/slf4j-android
5556
//implementation "org.slf4j:slf4j-android:1.7.25"
56-
// EXAMPLE - replace gson with jackson-databind json parser
57-
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
57+
58+
implementation "androidx.appcompat:appcompat:1.2.0"
59+
implementation "com.google.android.material:material:1.2.1"
5860

5961
// required by API-16
6062
implementation "com.google.code.gson:gson:$gson_ver"

test-app/src/main/resources/android-logger.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# https://github.com/noveogroup/android-logger
2020
# Valid logging levels are: VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT
2121

22-
# Default configuration (disabled because it would override tags from the application)
23-
#root=DEBUG:Optly
22+
# Default configuration
23+
root=DEBUG:Optly
2424

2525
# Core
2626
logger.com.optimizely.ab.Optimizely=DEBUG:Optly.core

0 commit comments

Comments
 (0)