My app will be running in the background and uploads data to the server from time to time. Everything works fine, except that I want my app NOT to upload data to the server on its own by turning on network services. Instead, I want it to only start the upload process when another app or service has started a connection. In some words, I wanna be parasitic to the other app.
I know for a fact that this can be done in Android, however I couldn’t find anything in the documentation. Any idea?
I would try registering for the broadcast intent WifiManager.NETWORK_STATE_CHANGED_ACTION, via a BroadcastReceiver. See http://developer.android.com/reference/android/net/wifi/WifiManager.html#NETWORK_STATE_CHANGED_ACTION.
Hope that helps!