Sending data to a server when the device is connected to Internet
<p>My app needs to send some data to a server when the device is connected.</p>

<p>I have been reading about native Android Broadcast actions. I was willing to find a way to use one as gmail does when the device connects to the Internet. (The "loading" icon on the top while it syncs mails)</p>

<p>Is it <a href="http://developer.android.com/reference/android/content/Intent.html#ACTION_SYNC" rel="nofollow">ACTION_SYNC</a> what I am looking for?</p>

<p>If not, how does gmail knows when the device connects to internet?</p>
