I have two questions in which I would like a bit more clarification / help with. I've done networking before on windows but started doing it with apps and I found some parts to be a little different. The setup I have right now is a multiple client Tcp server that the android connects to, logs in, and that client can then send and receive messages.
Now for the questions...
1. On the client side, how should I go about receiving messages. Should I make a thread for receiving? If so where should I run the thread? I'm more or less confused on where to put a while loop or a thread since apps seem to be based more on user commands .
2. How should I go about checking whether the app is in sleep mode (tabbed out of the app) or fully closes. Looked around last Thursday and Friday, but couldn't really find much.
Any help or links to useful resources will be much appreciated.