send multiple text from bluetooth using outputStream android


send multiple text from bluetooth using outputStream android



I want to send multiple texts using output stream.



for example:



editText1 send 'banana', editText2 send 'corn', editText3 send 'bird' at the same time.



do you have any idea how to do it? and please give me some example because I always get confused, I'm new in the android studio.



thanks.




1 Answer
1



There are multiple options. But simple way is to send JSONObject. like,


JSONObject obj = new JSONObject();
obj.put("et1","banana");
obj.put("et2","corn");
obj.put("et3","bird");



and you can use this Json as String. Like,


obj.toString();





can i use rfcomm when i send it via bluetooth? won't it cause problem? @ABK
– azizahn
Jul 1 at 6:58






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

How to input without newline? (Python)

C++ thread error: no type named ‘type’ MINGW

Analog for TagView in flutter