Languages

Menu
Sites
Language
how to do both way json communication using Samsung Accessory SDK?

 

I am trying to implement a both way communication between my Xamarin.Android app and Samsung Galaxy watch. Basically it should be;
  • Phone connects to the watch and sends an initial data as json
  • user processes this json data, amends on the watch and sends back to the phone

in this case, data should be send back and forth on both way but Samsung Tizen documentation says One the of the should be provider and other should be Consumer according to this documentation

if I understand correctly, i can either send data from phone to watch or watch to phone as consumer only can send command/text to the provider. Is there anyway to achieve to send both way as i described above?

Beside that i dont quite understand the difference between these 2 architecture https://developer.samsung.com/galaxy-watch/develop/samples/companion/hello-net

https://developer.samsung.com/galaxy-watch/develop/samples/companion/hello-message-net

Both looks identical beside first one works with peer without connection, 2nd one must establish a connection. what is the advantage one over another? or difference?

 

Responses

1 Replies
Tizen .NET

After establishing the connection between Java (Android Phone) and Tizen (Samsung Galaxy Watch) companion apps, both apps can send and receive data.

I'm not sure what are the advantages of using a service connection. I assume Connection.Send() is more efficent in transmitting bigger amount of data. (After establishing connection once, sending data is probably faster with lower delay. Peer.SendMessage() would be easier to use.

https://stackoverflow.com/questions/54608062/what-is-the-difference-between-sap-socket-send-data-and-sap-peer-agent-send-data

This artical is related to SAP C API but it applies to SAP C# API.