Search code examples
androidhttpwifigsm

Make HTTP connection using GSM network, not WiFi


I need to make HTTP request on Android using GSM connection, not Wifi.

My current solution is to disconnect from all wi-fi connections and perform a request. Is there any better solution? I could not find any relevant methods in the API (I looked in package org.apache.http, but it seems it is completely unaware of what type of connection should be used).


Solution

  • but it seems it is completely unaware of what type of connection should be used

    correct - indirection is your friend - Location Services (for example) are just the same