0

I have an android application that starts a server NanoHTTPD. The problem happens when I start the server, I leave the application in the background, and I start playing a game or a heavy application. After a few minutes the server is stopped. How I can keep the server started, even playing games or using other applications? (like AirDroid)

Thanks in advance.

Jonathan Toledo
  • 359
  • 4
  • 19

1 Answers1

2

It'll get killed by the Android system unless you place it into a Service and make it a foreground service.

323go
  • 14,143
  • 6
  • 33
  • 41