detect if there is a connection to internet

by Marton Kodok » Sun, 15 Nov 2009 17:33:22 GMT

Sponsored Links

I want to detect if there is a connection to Internet before launching a
How can I detect it?



detect if there is a connection to internet

by Smelly Eddie » Mon, 16 Nov 2009 01:14:14 GMT

 You can use ConnectivityManager and check the returned networkinfo


Sponsored Links

detect if there is a connection to internet

by Indicator Veritatis » Mon, 16 Nov 2009 06:55:59 GMT

 Now maybe Marton will figure it out, he was, after all, the person who
asked the question. But I cannot figure out how to tell whether the
phone is connected to the Internet from NetworkInfo, not even from the
more detailed version, 'NetworkInfo.DetailedState'

Rather, the questions this object answers are just a little different:
on the Wifi net, it tells you when you have a 802.11 connection, on
the phone network, it tells you when the phone network is idle/
connected/disconnected. But I see no way to differentiate between, say
for example, 802.11 MAC level connectivity and 'Internet', which has
to mean at least IP if not TCP level connectivity. After all: the text
does say, "Describes the status of a network interface of a given type
(currently either Mobile or Wifi)". Both of these interfaces can
return CONNECTED without any connection to the Internet being
available. Hopefully, that is not too common in the Mobile case, but
it certainly is common in the WiFi case: it is distressingly frequent
that you have connectivity to the local net, or even to the local
access point -- and no further.

Now maybe this is good enough for Marton. But the question he
originally asked was about "Internet connectivity", which really is


detect if there is a connection to internet

by Mark Murphy » Mon, 16 Nov 2009 12:48:52 GMT 

Mark Murphy (a Commons Guy)  | 

Warescription: Three Android Books, Plus Updates, $35/Year


detect if there is a connection to internet

by Jabbslad » Mon, 16 Nov 2009 12:48:58 GMT

Other Threads

1. How to create a custom View

Hi guys
I have to make a custom ToggleButton view.
The purpose of that view should be that :-

When the user clicks the button the background image should change
thats it

Please tell me how to achieve this
or direct me to some tutorials for beginners.


2. Windows drivers, inf file, and device ID's

Unless I'm doing something wrong and have wrong information, whenever
I have a new device that I want to deploy an application to from a
Windows dev machine, I have to make sure that I have the device ID in
my android_winusb.inf file.  When I switched phones recently, this was
the solution I came up with by googling the problem (new phone not
showing up in launch dialog) and it worked.

My coworker has a Motorola Devour and I'm having the same problem.  I
plug his phone into my dev machine and attempt to deploy, but his
device doesn't show up in the list (he has debugging turned on, my app
has debugging enabled in the manifest, and the USB connected alerts
show up on his phone when connected).

I can't find a device id for my inf file for a Motorola Devour
anywhere online.  Anyone have any ideas?  Thanks!


3. Transfer Preferences from demo to paid app

4. smooth scrolling

5. What are differences between onRetainNonConfigurationInstance() and onSaveInstanceState()

6. Runtime Exception in MediaRecorder.setAudioSource() method

7. What is an Adapter??