Skip to content

Commit 87722d6

Browse files
author
Jeremy Osterhoudt
committed
- Upgraded the SDK to v1.1.0
- Added an example of how you can subscribe to notifications emitted from the SDK - Added color coding to JavaScript console.logs that appear in the Java console output.
1 parent a727f11 commit 87722d6

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/main/java/com/ge/predix/mobile/ReferenceApplication.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
import com.ge.predix.mobile.core.MobileManager;
55
import com.ge.predix.mobile.core.PredixMobileConfiguration;
66
import com.ge.predix.mobile.core.ViewInterface;
7+
import com.ge.predix.mobile.core.notifications.InitialReplicationCompleteNotification;
78
import com.ge.predix.mobile.exceptions.InitializationException;
89
import com.ge.predix.mobile.platform.PlatformContext;
910
import com.ge.predix.mobile.platform.WindowView;
11+
import com.google.common.eventbus.Subscribe;
1012
import de.codecentric.centerdevice.MenuToolkit;
1113
import javafx.application.Application;
1214
import javafx.application.Platform;
@@ -158,12 +160,18 @@ public WindowView getWindowView() {
158160
loadProxyIfNeeded();
159161
try {
160162
mobileManager.start();
163+
mobileManager.getNotificationRegistrar().registerListener(this);
161164
} catch (InitializationException e) {
162165
e.printStackTrace();
163166
}
164167
}).start();
165168
}
166169

170+
@Subscribe
171+
public void listenForInitialReplicationComplete(InitialReplicationCompleteNotification notification) {
172+
System.out.println("\u001B[33m" + "Received replication complete notification" + "\u001B[0m");
173+
}
174+
167175
private void loadProxyIfNeeded() {
168176
setProxyValue("http.proxyHost", "http.proxyPort");
169177
setProxyValue("https.proxyHost", "https.proxyPort");

src/main/java/com/ge/predix/mobile/debugging/ConsoleLogBridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
*/
1010
public class ConsoleLogBridge {
1111
public void log(String text) {
12-
System.out.println(text);
12+
System.out.println("\u001B[33m" + text + "\u001B[0m");
1313
}
1414
}

0 commit comments

Comments
 (0)