summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2019-03-14 17:13:01 -0400
committerJoey Grover <joeygrover@gmail.com>2019-03-14 17:13:01 -0400
commit181bf3632a6daaccb70244e75a2878321a279805 (patch)
tree6cf8e6f3cd3f21a880138ea5c834a64a04d8e374
parent44b1b5d342c1874a6cf5cbceeed07f4a1557a952 (diff)
downloadsdl_android-181bf3632a6daaccb70244e75a2878321a279805.tar.gz
Fix sample apps
-rw-r--r--javaEE/src/main/java/hello_sdl_ee/Main.java78
-rw-r--r--javaSE/src/main/java/hello_sdl/Main.java78
2 files changed, 2 insertions, 154 deletions
diff --git a/javaEE/src/main/java/hello_sdl_ee/Main.java b/javaEE/src/main/java/hello_sdl_ee/Main.java
index 85307fa52..a19985692 100644
--- a/javaEE/src/main/java/hello_sdl_ee/Main.java
+++ b/javaEE/src/main/java/hello_sdl_ee/Main.java
@@ -24,7 +24,7 @@ public class Main {
public static void main(String[] args) {
// testRAIString();
- startSdl();
+ attemptSdlManager();
}
public static void testRAI(){
@@ -108,79 +108,5 @@ public class Main {
}
-
- public static void startSdl(){
- System.out.println("Hello World!");
-
- Thread thread = new Thread(new Runnable() {
- boolean end = false;
-
- @Override
- public void run() {
- LifecycleManager.AppConfig config = new LifecycleManager.AppConfig();
- config.setAppID("234523452345234");
- config.setAppName("JavaChip");
-
- WebSocketServerConfig serverConfig = new WebSocketServerConfig(5679,0);
- LifecycleManager lifer = new LifecycleManager(config, serverConfig, new LifecycleManager.LifecycleListener() {
- @Override
- public void onProxyConnected(final LifecycleManager lifeCycleManager) {
- System.out.print("On proxy CONNECTED");
-
- lifeCycleManager.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- Log.i(TAG, "on notified");
- OnHMIStatus hmiStatus = (OnHMIStatus)notification;
-
- if(HMILevel.HMI_FULL.equals(hmiStatus.getHmiLevel())) {
- if (true || hmiStatus.getFirstRun()) {
- //TOD DO a show
- Show show = new Show();
- show.setMainField1("There's snake in my boots");
- show.setMainField2("YEET THAT SUCKER!");
- lifeCycleManager.sendRPC(show);
-
-
- }
- }
- }
- });
- }
-
- @Override
- public void onProxyClosed(LifecycleManager lifeCycleManager, String info, Exception e, SdlDisconnectedReason reason) {
- System.out.print("On proxy CLOSED");
- end = true;
- }
-
- @Override
- public void onServiceEnded(LifecycleManager lifeCycleManager, OnServiceEnded serviceEnded) {
- System.out.print("On service ENDED");
-
- }
-
- @Override
- public void onServiceNACKed(LifecycleManager lifeCycleManager, OnServiceNACKed serviceNACKed) {
- System.out.print("On service NAKed");
-
- }
-
- @Override
- public void onError(LifecycleManager lifeCycleManager, String info, Exception e) {
- System.out.print("OnError " + info);
-
- }
- });
- lifer.start();
- while(true || !end){
-
- }
- }
-
- });
-
- thread.start();
-
- }
+
}
diff --git a/javaSE/src/main/java/hello_sdl/Main.java b/javaSE/src/main/java/hello_sdl/Main.java
index afe738f3b..9faf5b5ab 100644
--- a/javaSE/src/main/java/hello_sdl/Main.java
+++ b/javaSE/src/main/java/hello_sdl/Main.java
@@ -3,16 +3,12 @@ package hello_sdl;
import android.util.Log;
import com.smartdevicelink.managers.SdlManager;
import com.smartdevicelink.managers.SdlManagerListener;
-import com.smartdevicelink.managers.lifecycle.LifecycleManager;
import com.smartdevicelink.marshal.JsonRPCMarshaller;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
-import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
import com.smartdevicelink.proxy.rpc.*;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCRequestListener;
import com.smartdevicelink.transport.WebSocketServerConfig;
@@ -121,78 +117,4 @@ public class Main {
manager.start();
}
- public static void startSdl(){
- System.out.println("Hello World!");
-
- Thread thread = new Thread(new Runnable() {
- boolean end = false;
-
- @Override
- public void run() {
- LifecycleManager.AppConfig config = new LifecycleManager.AppConfig();
- config.setAppID("234523452345234");
- config.setAppName("JavaChip");
-
- WebSocketServerConfig serverConfig = new WebSocketServerConfig(5679,0);
- LifecycleManager lifer = new LifecycleManager(config, serverConfig, new LifecycleManager.LifecycleListener() {
- @Override
- public void onProxyConnected(final LifecycleManager lifeCycleManager) {
- System.out.print("On proxy CONNECTED");
-
- lifeCycleManager.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- Log.i(TAG, "on notified");
- OnHMIStatus hmiStatus = (OnHMIStatus)notification;
-
- if(HMILevel.HMI_FULL.equals(hmiStatus.getHmiLevel())) {
- if (true || hmiStatus.getFirstRun()) {
- //TOD DO a show
- Show show = new Show();
- show.setMainField1("There's snake in my boots");
- show.setMainField2("YEET THAT SUCKER!");
- lifeCycleManager.sendRPC(show);
-
-
- }
- }
- }
- });
- }
-
- @Override
- public void onProxyClosed(LifecycleManager lifeCycleManager, String info, Exception e, SdlDisconnectedReason reason) {
- System.out.print("On proxy CLOSED");
- end = true;
- }
-
- @Override
- public void onServiceEnded(LifecycleManager lifeCycleManager, OnServiceEnded serviceEnded) {
- System.out.print("On service ENDED");
-
- }
-
- @Override
- public void onServiceNACKed(LifecycleManager lifeCycleManager, OnServiceNACKed serviceNACKed) {
- System.out.print("On service NAKed");
-
- }
-
- @Override
- public void onError(LifecycleManager lifeCycleManager, String info, Exception e) {
- System.out.print("OnError " + info);
-
- }
- });
- lifer.start();
- while(true || !end){
-
- }
- }
-
- });
-
- thread.start();
-
- }
}