Connectivity boolean to NOT display map?

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Connectivity boolean to NOT display map?

Postby iaindownie » Tue Feb 22, 2011 2:51 pm

I want to use the following, or similar code, within a mapping application, where the map, although showing, is secondary to getting lats/longs and grid references from the GPS (meaning the map just helps you see where you are, the GPS is returning the true data to the user.

Code to detect if you have a connection:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. boolean online = true;
  2. ConnectivityManager mConnectivity;
  3. NetworkInfo info = mConnectivity.getActiveNetworkInfo();
  4. if (info == null || !mConnectivity.getBackgroundDataSetting()) {
  5.  online = false;
  6. }
  7.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


But, if there is no connection, I'd rather not show the grey, empty map screen that you typically get when looking at a map out of network range. Instead, I would rather show a warning message or something that means the user will at least not panic or get frustrated.

Anyone know if it's possible, and if this code i hacked from StackOverFlow helps?
Thanks
User avatar
iaindownie
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon Dec 29, 2008 4:08 pm
Location: Thetford, Norfolk, UK

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 8 guests