requestRouteToHost always returns false on AVD

by Tina » Tue, 20 Jul 2010 21:59:08 GMT

Sponsored Links
 Hi, all!
I need to check web site availability and use requestRouteToHost  for
that purpose. On real device everything works fine, but on emulator
requestRouteToHost  always return "false".
What's wrong?
Code is:

public static boolean isHostAvailable(Context context, String
urlString) throws UnknownHostException, MalformedURLException {
                boolean ret = false;
                int networkType = ConnectivityManager.TYPE_WIFI;
                ConnectivityManager cm = (ConnectivityManager)
                if(cm != null){
                        NetworkInfo nf = cm.getActiveNetworkInfo();
                        if(nf != null){
                                networkType = nf.getType();
                        URL url = new URL(urlString);
                        InetAddress  iAddress = 
                        ret = cm.requestRouteToHost(networkType,
                return ret;


Other Threads

1. Android Debugger is DOG Slow

When I run my app in the de{*filter*}, via a USB cable, it is completely
and utterly unusably slow.  I have 2.3.3 installed on my NexusOne.
How does Google expect us to work with a complete {*filter*}environment
like this?

- Eric


2. Can I attach any other kinds of file while replying someone's email via Android GMail?

I have a question about Android GMail file attaching.

When I tried to reply somebody's email via Android GMail, and I want
to share some file to him (not image file, it could be some PDFs,
office files...or any other file).
I can install File Manager-liked app for attaching these files. But,
even I attached PDF files successfully while replying, in the end
files were not attached successfully!

Is that GMS concept?

Can anybody teach me how to do for using GMail to attach other files
which is not image file?

Many thanks.


3. how to port Gingrerbread on Neofreerunner

4. Gingerbread Calendar issue

5. In-App Purchase onPurchaseStateChange not called

6. Android Web Solutions

7. ImageMagick and NDK