0

I want transfer server response data from mobile to google glass through bluetooth socket.For this which of the following method is efficient and simple to implement?

1) Convert JSON object to byte array,and write on socket output stream,then receive it on glass side and parse json. 2) Parse JSON on mobile itself and wrap it to an Object,convert the object to byte array,and write on socket output stream,then receive it on glass side and use directly.

Also android JSONReader or GSON,which one is efficient?(I think both are same,but jsonreader supports on above ICS,that is not a problem).Also which is easy to convert Java objects and viceversa?

Ramprasad
  • 7,981
  • 20
  • 74
  • 135
  • Why don't you try all the methods and do a performance test. The answer to this question provides some good information on getting an accurate execution time. Personally that is the approach I take to this kind of issue. http://stackoverflow.com/questions/447739/java-performance-testing – Jesson Atherton Mar 20 '15 at 02:24
  • @Ramprasad JSON is a string no need to convert it to a byte array. I think you meant "serialise your object to JSON and write it to the socket" – phuzi Nov 06 '15 at 13:19

0 Answers0