[android-developers] ConnectivityManager isConnected REAL Network Connection FAIL

2009-05-25 Thread Diego

Hi I'm facing a problem with ConnectivityManager.

I check with ConnectivityManager if I'm connected

   conManager.getActiveNetworkInfo().isConnected();

Returns true, but I can't route to host.

After this check I try to load a URL and shows me a Web page not
available

   browser.loadUrl(http://www.google.com;);

How can I check if I have real access to network.   Maybe
requestRouteToHost but it have to be simpler.

Any solution to check REAL Network connection.





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ConnectivityManager with the emulator

2008-12-08 Thread nimbus83

Hello,

I want to implement with the emulator an application that receives
information when the network connection is connected or disconnected.
How can I register a receiver that gets the changes in the network
connection?

I have tried this:

public class ConnectionChangeReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
ConnectivityManager connectivityManager =
(ConnectivityManager)
context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetInfo = 
connectivityManager.getActiveNetworkInfo
();
NetworkInfo mobNetInfo = 
connectivityManager.getNetworkInfo
(ConnectivityManager.TYPE_MOBILE);
}
}

IntentFilter intentFilter = new IntentFilter();
registerReceiver(new 
ConnectionChangeReceiver(), intentFilter);

What should be the input of the filter so that the ConnectivityManager
sends information to my receiver?

And one more question.

I have done some tests with the emulator with the following code:

ConnectivityManager connManager = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connManager.getActiveNetworkInfo();

I get the information that the MOBILE network type is available and
its state is CONNECTED. If I disable the local area connection on my
PC I get the same information. How can make the network information
change? How can I disable/enable the connection for simulations?

Thank you in advance.

Best wishes!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---