Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update deprecated calls #240

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions app-java/src/main/java/ly/count/java/demo/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void timedEventWithSumCountSegmentationAndDuration() {
}

static void setLocation() {
Countly.api().addLocation(31.5204, 74.3587);
Countly.instance().location().setLocation("UK", "London", "31.5204, 74.3587", null);
}

static void setUserProfile() {
Expand All @@ -58,7 +58,7 @@ static void setUserProfile() {
Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.ORGANIZATION, "Tester");
Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PHONE, "+123456789");
Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE, new byte[] { 1, 2, 3, 4, 5 });
//Countly.instance().userProfile().setProperty(UserPropertyKeys.PICTURE_PATH, "test.png"); to provide local path
//Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE_PATH, "test.png"); //to provide local path
Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE_PATH, "https://someurl.com/test.png");
Countly.instance().userProfile().save();
}
Expand Down Expand Up @@ -116,19 +116,18 @@ static void reportFeedbackWidgetManually(CountlyFeedbackWidget widget) {
}

static void recordStartView() {
Countly.api().view("Start view");
Countly.instance().views().startView("Start view");
}

static void recordAnotherView() {
Countly.api().view("Another view");
Countly.instance().views().startView("Another view");
}

static void recordCrash() {
try {
throw new ArithmeticException("/ by zero");
} catch (Exception e) {
e.printStackTrace();
Countly.api().addCrashReport(e, false, "Divided by zero", null, "sample app");
Countly.instance().crashes().recordHandledException(e);
}
}

Expand Down Expand Up @@ -301,10 +300,10 @@ public void LogHappened(String logMessage, Config.LoggingLevel logLevel) {
recordCrash();
break;
case 12:
Countly.session().view("example_view").start(true);
Countly.instance().views().startView("example_view");
break;
case 13:
Countly.session().view("example_view").stop(false);
Countly.instance().views().stopViewWithName("example_view");
break;
case 14:
changeDeviceIdWithMerge();
Expand Down
Loading