I am implementing a socket application where one phone will be a client and the other will be a server. The program is able to send strings using print writer just fine from
Thanks everyone , I found the error.
The toast messages have to be inside the UI thread or the handler . As I had a few of them in a non UI thread, it began to throw the exception.