Android O – Detect connectivity change in background

Second edit: I’m now using firebase’s JobDispatcher and it works perfect across all platforms (thanks @cutiko). This is the basic structure: public class ConnectivityJob extends JobService{ @Override public boolean onStartJob(JobParameters job) { LogFactory.writeMessage(this, LOG_TAG, “Job created”); connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { connectivityManager.registerNetworkCallback(new NetworkRequest.Builder().build(), networkCallback = new ConnectivityManager.NetworkCallback(){ // -Snip- }); }else{ … Read more

Can anybody explain what is difference between unbound and bound service in android

Bound Service A service is bound when an application component binds to it by calling bindService(). A bound service offers a client-server interface that allows components to interact with the service, send requests, get results, and even do so across processes with interprocess communication (IPC). When the last client unbinds from the service, the system … Read more