Check if device is online or offline

by Simon » Fri, 22 Apr 2011 03:39:26 GMT


Sponsored Links
 Hi,

I have hunted around, but can't seem to find an answer to this.  I am
working on an app that will be using local storage through the SQLite
DB, but will also be syncing to a remote server.  If the device is
online, I would like to be able to sync to the remote server, and if
it is offline, I would like to store an event that indicates there is
data to send once the device is online again.  But I can't seem to
find in the API how to query for the current online/offline status of
the device.  Is there something like this available?

Thanks,

Simon

-- 



Re: Check if device is online or offline

by Mark Murphy » Fri, 22 Apr 2011 04:00:51 GMT


 See ConnectivityManager and getActiveNetworkInfo().






-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android 3.0 Programming Books:  http://commonsware.com/books 

-- 


Sponsored Links


Other Threads

1. notification bar improvement

It would be nice to have a long-press option for notification bar
items, allowing for archive/reply/delete/etc for gmail, and other
functionality for native apps. Long-press to clear individual items
from notifications would be handy as well.

--~--~---------~--~----~------------~-------~--~----~

2. mAPPn, who developed aHome, is looking for Android themes and widgets to buy

Hi there,

My name is Brian and I am the Operation Manager of mAPPn, a mobile
application and software provider based in Southern California. I am
posting the message here looking to potentially partnerships with
Android designers and developers.

In short, we have had great success on the Android platform with very
successful applications. Our most prominent, titled aHome, gained
tremendous popularity amongst users and even caught the attention of
T-
Mobile USA, who then proceeded to form a partnership with our company
for their successful G1 and MyTouch mobile devices. Together with T-
Mobile, we have created FreshFace, a home-shell customization
application that allows users to customize their background, icons,
and widgets. All of our aHome themes are very popular in Android
market. Check out the latest theme, Yan yan theme by
http://www.cyrket.com/package/com.mappn.ahome.theme.yanyan. You also
can browse the ahome themes in Market via your android phone.

Developing ourselves as the leading android content provider, we are
looking to partner with designers and developers who can create unique
and creative themes, widgets for our aHome product. We will provide
the development guide. So if you are interested and would like more
information on potential opportunities in designing themes for our
platform, please feel free to contact me at bri...@mappn.com. In the
meantime, please visit our website at www.mappn.com  to learn more
about who we are.

Thanks and I look forward to hearing from you.

--~--~---------~--~----~------------~-------~--~----~

3. Active Installs?...

4. help,a simple activity error

5. Unicode support

6. Force Roaming with ServiceState class?

7. AnimationDrawable programmatic example