【问题标题】:Host android application to initiate communicate with tizen application(Android to tizen)宿主 android 应用程序发起与 tizen 应用程序的通信(Android 到 tizen)
【发布时间】:2015-06-13 11:36:10
【问题描述】:

我有一个 android 应用程序,它需要在需要时与 gear 2 设备建立连接。它只需要在 tizen 上问一个问题(是或否)并得到回复我该怎么做?有许多教程(helloaccessoryprotocol 应用程序)从 tizen 启动连接,但我需要的是其他方式

findPeerAgents() call gives the below log 

onFindPeerAgentResponse arg0 =sapimageswitcher arg1 =0
In try block of find peer agent response
SAP CONNECTION CONSTRUCTOR
onServiceConnectionResponse result error =1030

这里的错误码意思是CONNECTION_FAILURE_PEERAGENT_NO_RESPONSE

在 agentCallback 的 tizen 端,我包含如下 onrequest 函数

var agentCallback = {
onrequest : function(peerAgent) {
    console.log(" onrequest " + peerAgent);
    SAAgent.acceptServiceConnectionRequest(peerAgent);
},
onconnect : function(socket) {
    console.log( "agentCallback onconnect" + socket);
    SASocket = socket;
    alert("SAP Connection established with RemotePeer");
    createHTML("startConnection");
    SASocket.setSocketStatusListener(function(reason){
        console.log("Service connection lost, Reason : [" + reason + "]");
        disconnect();
    });
},
onerror : onerror 
};

如有遗漏请告诉我,谢谢。

【问题讨论】:

    标签: android tizen-wearable-sdk tizen-web-app samsung-galaxy-gear


    【解决方案1】:

    您是否尝试过颠倒消费者和提供者的角色。我想这应该解决它。如果角色、频道都设置正确,还要检查您的配置 XML 文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-23
      • 1970-01-01
      • 2012-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-31
      • 2013-02-17
      相关资源
      最近更新 更多