Forum General

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Android app networking question

BlockyNewtBlockyNewt Member ✭✭
edited October 2020 in General

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.
Thank you!

Sign In or Register to comment.