From c0eba99d7c828dada85e47828cf93a8ac6a0dd6b Mon Sep 17 00:00:00 2001 From: turtledreams Date: Mon, 17 Apr 2023 20:02:48 +0900 Subject: [PATCH 01/18] max --- CHANGELOG.md | 3 +++ sdk/src/main/java/ly/count/android/sdk/Countly.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36ff7ceb1..89486450f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 22.09.4 +* maxSegmentationValuesDefault is now 100 (from 30) + ## 22.09.3 * Added "previous event ID" logic for non-internal events diff --git a/sdk/src/main/java/ly/count/android/sdk/Countly.java b/sdk/src/main/java/ly/count/android/sdk/Countly.java index a32c39b2a..70dff7bed 100644 --- a/sdk/src/main/java/ly/count/android/sdk/Countly.java +++ b/sdk/src/main/java/ly/count/android/sdk/Countly.java @@ -122,7 +122,7 @@ public enum CountlyMessagingProvider { //SDK limit defaults final int maxKeyLengthDefault = 128; final int maxValueSizeDefault = 256; - final int maxSegmentationValuesDefault = 30; + final int maxSegmentationValuesDefault = 100; final int maxBreadcrumbCountDefault = 100; final int maxStackTraceLinesPerThreadDefault = 30; final int maxStackTraceLineLengthDefault = 200; From 50b0753eb14663b6ebd5cbd470de238b21aee81a Mon Sep 17 00:00:00 2001 From: turtledreams Date: Tue, 23 May 2023 21:43:49 +0900 Subject: [PATCH 02/18] gl hf --- .../demo/ActivityExampleRemoteConfig.java | 30 ++ .../layout/activity_example_remote_config.xml | 21 ++ .../ly/count/android/sdk/ConnectionQueue.java | 13 + .../ly/count/android/sdk/CountlyStore.java | 9 + .../count/android/sdk/ModuleRemoteConfig.java | 259 ++++++++++++++++++ .../android/sdk/RequestQueueProvider.java | 2 + .../ly/count/android/sdk/StorageProvider.java | 4 + 7 files changed, 338 insertions(+) diff --git a/app/src/main/java/ly/count/android/demo/ActivityExampleRemoteConfig.java b/app/src/main/java/ly/count/android/demo/ActivityExampleRemoteConfig.java index 47e0e71c0..3bb5e4a03 100644 --- a/app/src/main/java/ly/count/android/demo/ActivityExampleRemoteConfig.java +++ b/app/src/main/java/ly/count/android/demo/ActivityExampleRemoteConfig.java @@ -131,6 +131,36 @@ public void onClickRemoteConfigPrintValues(View v) { t.show(); } + // For fetching all variants with a button click + public void onClickFetchAllVariants(View v) { + Countly.sharedInstance().remoteConfig().testFetchAllVariants(new RemoteConfigCallback() { + @Override + public void callback(String error) { + if (error == null) { + Toast.makeText(getApplicationContext(), "Fetch finished", Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(getApplicationContext(), "Error: " + error, Toast.LENGTH_SHORT).show(); + } + } + }); + } + + // To get all variants from the storage and show them with a toast + public void onClickVariantsPrintValues(View v) { + Map values = Countly.sharedInstance().remoteConfig().getAllVariants(); + + Countly.sharedInstance().L.d("Get all variants: [" + values.toString() + "]"); + + Toast t = Toast.makeText(getApplicationContext(), "Stored Variant Values: [" + values.toString() + "]", Toast.LENGTH_LONG); + t.setGravity(Gravity.BOTTOM, 0, 0); + t.show(); + } + + // To clear all stored variants + public void onClickVariantsClearValues(View v) { + Countly.sharedInstance().remoteConfig().clearStoredVariants(); + } + @Override public void onStart() { super.onStart(); diff --git a/app/src/main/res/layout/activity_example_remote_config.xml b/app/src/main/res/layout/activity_example_remote_config.xml index 6112959bb..bc3d45a4d 100644 --- a/app/src/main/res/layout/activity_example_remote_config.xml +++ b/app/src/main/res/layout/activity_example_remote_config.xml @@ -58,4 +58,25 @@ android:onClick="onClickRemoteConfigPrintValues" android:text="Remote Config Print Stored Values" /> +