I've come into this thread late, but from reading the code you present and the docs, combined with my suspicious mind, it's leading me to think this:

You ask for the system to use HIPRI over TYPE_MOBILE, which it says it grants. But I can't see anything in the docs that suggests that this takes priority over *all* other types of network routes. It suggests that *if* the system were to use TYPE_MOBILE for comms, *then* it would use HIPRI - but if it decides to use TYPE_WIFI instead, then your calls are having no effect.

An analogy would be changing current directories on Windows from the command prompt. If you open the prompt, you are most likely going to be at C:\Users\MyLogin (on Windows 7) or something like that.

If you type cd D:\SomeSubDir it accepts it. But if you then type dir, you get the files from your own users directory - not the D directory.

If you now type d:, and then dir, *now* you get the files on the D subdirectory you changed to.

In other words, despite asking for a route to SomeSubDir over the D 'network', we were still on the 'C' network effectively.

My point (there was always hope I was getting to one) is that as far as the device is concerned, you've created a route over TYPE_MOBILE / HIPRI, but TYPE_WIFI is still an option and it chooses to use it.

Is it possible that setNetworkPreference(TYPE_MOBILE) is the last piece of the puzzle?

(Inspired by this article: http://stackoverflow.com/questions/2513713/how-to-use-3g-connection-in-android-application-instead-of-wi-fi)


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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

Reply via email to