0

Hello the android app that I am making, after a few hours on stand-by lost the WiFi connection. I tried with a timer and check connection but the application freezes after a few hours and continue to lost connection.

SahdevRajput74
  • 754
  • 7
  • 18
Luk4
  • 13
  • 4
  • try to clean and rebuild the project – Usman Ali Mar 20 '18 at 12:38
  • 1
    I've already tried but the timer will stop working after a few hours the smartphone lost the connection – Luk4 Mar 20 '18 at 12:44
  • possible duplicate of [link](https://stackoverflow.com/questions/18285172/code-for-checking-internet-connection-is-not-working-properly) – Usman Ali Mar 20 '18 at 12:48
  • Thank you. The control works but after a few hours in standby the smartphone loses the connection and the application freezes and when the phone resumes, it resumes the timer and it takes a few seconds to connect at the wifi(I have to make it immediately in the background) – Luk4 Mar 20 '18 at 12:55
  • put the code here you have done – Usman Ali Mar 20 '18 at 12:56

1 Answers1

1

I think when the phone is in stand by the activity is going to be paused eventually stoped, for this reason the event paused eventually also stopped is going to be called, after pressing the home button the function Resume may be also start is going to be called.

Please have a look to this article https://stuff.mit.edu/afs/sipb/project/android/docs/training/basics/activity-lifecycle/pausing.html

from my perspective the time should be stoped when the app in background or phone in stand by

For connectivity I will advice you to use the connectivity Module from Nuget, this plugin is really stable.