Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:22:08+00:00 2026-06-17T19:22:08+00:00

For a personal project, I have to check if the device LAN ip for

  • 0

For a personal project, I have to check if the device LAN ip for MMS is reachable.
I’ve already found the IP with the provided APNs. Now I need to user the requestRouteToHost method to check if the proxy found is valid or not.

The code is perfectly working on devices running android 2.3 to 4.0 and from 4.1 to above.
But it throws me an error under 4.0.3 and 4.0.4. I’ve tested it on multiple devices, that’s not a device issue but a version one.

if (!connMgr.requestRouteToHost(2, inetAddr)) {
     Log.e(TAG, "unable to request route to host");
     throw new IOException("Cannot establish route to proxy " + inetAddr);
} else {
     Log.e(TAG, "route to host requested");
}

The first condition is always true, which is a real problem.

The above code is contained into an AsynTask that I made like that:

private class AsyncRoute extends AsyncTask<String, Void, Void>
{
    @Override
    protected Void doInBackground(String... proxyAddr)
    {
        try
        {
            ensureRouteToHost(proxyAddr[0]);
            Log.e(TAG, "OK ACK");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        mInetAck = true;
        return null;
    }
}

The InetAddress found is -938825536 which is equivalent to 192.168.010.200.

To start this AsyncTask, I use the following code:

new AsyncRoute().execute(MMSProxy);
while (!mInetAck);

Basically, it waits acknowledgement before doing a couple of requests.

So, Does someone know if there is a trick to bypass this issue ? I mean is there a way to do the same thing as connMgr.requestRouteToHost(2, inetAddr) that could work on every device ?

Thanks.

Ps: Tested on Desire S 2.3, Desire S 4.0.3, Xperia lt30p 4.0.4, Nexus S 4.0.3, etc..

EDIT: On devices that throw an exception, a ping command on the route IP works:

> adb shell ping 192.168.10.200
PING 192.168.10.200 (192.168.10.200) 56(84) bytes of data.
64 bytes from 192.168.10.200: icmp_seq=1 ttl=251 time=4023 ms
64 bytes from 192.168.10.200: icmp_seq=5 ttl=251 time=81.3 ms

But the route request failed :s

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:22:10+00:00Added an answer on June 17, 2026 at 7:22 pm

    Problem solved.
    It can’t find the route to IP while the wifi is enabled. Simplest way is to disable wifi, do your stuff and then enable wifi.

    Here is the code I used:

    // Disable wifi if it's active
    WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
    if (wifiManager.isWifiEnabled())
    {
          mWasWifiActive = true;
          wifiManager.setWifiEnabled(false);
          Log.e(TAG, "Wifi was enabled, now Off.");
    }
    
    // Do stuff here
    
    // Re-enable wifi if it was active before routing
    if (mWasWifiActive)
    {
           WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
           wifiManager.setWifiEnabled(true);
           Log.e(TAG, "Wifi is back online.");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a personal project that's been online for sometime now. I've been keeping
I'm working on adding user submitted comments to a personal project. Comments have a
I have a personal project I'm planning and I came to a small hurdle.
For a personal project I have been implementing my own libstdc++. Bit by bit,
I have an old personal project written in Java 1.4 that I am porting
I'm using git for a personal project at the moment and have run into
I am working on a personal project where I need to manipulate values in
I'm working on a personal project and I have been running into lots of
I have a personal project that I'd like to build as an add-in for
I have smallish personal project consisting of the following Eclipse workspace. + +-MyApp //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.