Skip to content

Commit

Permalink
Merge pull request #208 from Countly/update_deprecated_calls
Browse files Browse the repository at this point in the history
[Android] update deprecated calls from App
  • Loading branch information
ArtursKadikis authored Jan 24, 2024
2 parents 6d58408 + 094342a commit dbaf788
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions app/src/main/java/ly/count/android/demo/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@
import android.media.AudioAttributes;
import android.net.Uri;
import android.os.Build;
import android.os.StrictMode;
import androidx.annotation.NonNull;

import android.os.Bundle;
import android.os.StrictMode;
import android.util.Log;

import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;

import com.google.firebase.messaging.FirebaseMessaging;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import ly.count.android.sdk.Countly;
import ly.count.android.sdk.CountlyConfig;
import ly.count.android.sdk.CrashFilterCallback;
Expand Down Expand Up @@ -182,9 +178,9 @@ public boolean filterCrash(String crash) {
// uncomment the line below to enable auto enrolling the user to AB experiments when downloading RC data
//.enrollABOnRCDownload()
// .setMaxRequestQueueSize(5)
.setAutoTrackingUseShortName(true)
.setAutomaticViewSegmentation(automaticViewSegmentation)
.setAutoTrackingExceptions(new Class[] { ActivityExampleCustomEvents.class })
.enableAutomaticViewShortNames()
.setGlobalViewSegmentation(automaticViewSegmentation)
.setAutomaticViewTrackingExclusions(new Class[] { ActivityExampleCustomEvents.class })

.setPushIntentAddMetadata(true)

Expand Down Expand Up @@ -217,23 +213,23 @@ public boolean filterCrash(String crash) {

.RemoteConfigRegisterGlobalCallback((downloadResult, error, fullValueUpdate, downloadedValues) -> {
if (error == null) {
Log.d(Countly.TAG, "Automatic remote config download has completed. " + Countly.sharedInstance().remoteConfig().getAllValues());
Log.d(Countly.TAG, "Automatic remote config download has completed. " + Countly.sharedInstance().remoteConfig().getValues());
} else {
Log.d(Countly.TAG, "Automatic remote config download encountered a problem, " + error);
}
})

.setTrackOrientationChanges(true)

.setRecordAppStartTime(true)
.setAppStartTimestampOverride(applicationStartTimestamp)

//.setMetricOverride(metricOverride)

//.enableServerConfiguration()

.setUserProperties(customUserProperties);

config.apm.enableAppStartTimeTracking()
.enableForegroundBackgroundTracking()
.setAppStartTimestampOverride(applicationStartTimestamp);

Countly.sharedInstance().init(config);
//Log.i(demoTag, "After calling init. This should return 'true', the value is:" + Countly.sharedInstance().isInitialized());

Expand Down

0 comments on commit dbaf788

Please sign in to comment.