附件SAP通信Tizen和Android PeerAgent\u无响应
目前,我正在为三星智能手表创建一个安全应用程序。我希望用户能够在智能手机上注册,并将这些数据发送到smartwatch应用程序。我遵循了三星关于附件SAP通信的教程。一切正常,直到我得到PEERAGENT_NO_响应错误,第一部分工作正常,它尝试连接没有任何问题 我调用tizen的方法如下: SAAgent.setServiceConnectionListeneragentCallback附件SAP通信Tizen和Android PeerAgent\u无响应,android,communication,samsung-mobile,tizen,accessory,Android,Communication,Samsung Mobile,Tizen,Accessory,目前,我正在为三星智能手表创建一个安全应用程序。我希望用户能够在智能手机上注册,并将这些数据发送到smartwatch应用程序。我遵循了三星关于附件SAP通信的教程。一切正常,直到我得到PEERAGENT_NO_响应错误,第一部分工作正常,它尝试连接没有任何问题 我调用tizen的方法如下: SAAgent.setServiceConnectionListeneragentCallback var agentCallback = { onconnect: function(soc
var agentCallback = {
onconnect: function(socket){
alert("agentCallback connect" + socket);
SASocket = socket;
alert("connected");
SASocket.setSocketStatusListener(function(reason){
console.log("Service Connection lost, Reason: ["+ reason+"]");
disconnect();
})
},
onerror: function(error){
alert("agentCallBack"+error);
}
};
当我调用SAAgent.setServiceConnectionListeneragentCallback时,下面的android代码被触发。但这总是返回PEERAGENT\u NO\u响应错误
@Override
protected void onServiceConnectionRequested(SAPeerAgent peerAgent){
//Toast.makeText(getBaseContext(), "TESTG", Toast.LENGTH_SHORT).show();
super.acceptServiceConnectionRequest(peerAgent)
}
我想知道我做错了什么。经过调试和一些帮助,我终于解决了问题: 这必须是公开的,而不是安卓端的保护。这导致运行时崩溃,无法向tizen可穿戴设备发送任何数据
public SAPServiceProviderConnection() {
super(SAPServiceProviderConnection.class.getName());
}
我还将android和tizen端的SupportedTransport改为:android端有BT,tizin端有WIFI/BT
<transport type="TRANSPORT_BT"/>
<transport type="TRANSPORT_WIFI"/>
Servicechannel,数据至高位:
<serviceChannel
id="104"
dataRate="high"
priority="low"
reliability="enable"/>