oscarjiv91 / Android-Check-Internet-Connection

Service that checks periodically if internet connection is available.
43 stars 14 forks source link

Service is not started. #3

Open kallaguntamanojkumar opened 5 years ago

kallaguntamanojkumar commented 5 years ago

I have the way to have suggested but service is not started. I have verified this by inserting logs in the ConnectionService class. Could you please suggest anything on this?

Babar-Bashir commented 5 years ago

Have you declared service in manifest?

kallaguntamanojkumar commented 5 years ago

Sorry, my bad, now I have declared service in the manifest and service method is invoked. But I turned ON WIFI and internet s active but still the app showing it doesn't have internet. Could you please help me with this?

Babar-Bashir commented 5 years ago

Please use my pull request https://github.com/Babar-Bashir/Android-Check-Internet-Connection

Babar-Bashir commented 5 years ago

Start your service Intent intent = new Intent(this, ConnectionService.class); intent.putExtra(ConnectionService.TAG_INTERVAL, 10); intent.putExtra(ConnectionService.TAG_URL_PING, "http://www.google.com"); intent.putExtra(ConnectionService.TAG_ACTIVITY_NAME, this.getClass().getName()); startService(intent);