Enable mobile network
Posted
by Sebi
on Stack Overflow
See other posts from Stack Overflow
or by Sebi
Published on 2010-05-14T09:50:13Z
Indexed on
2010/05/14
9:54 UTC
Read the original article
Hit count: 378
In my application it is necessary to have internet connection. Therefore i check while starting if a Internet connection is availaible. If not I ask the user if he would establish an Internet Connection, and what type (wifi oder mobile).
The wifi connection i can establish with the following code
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(true);
But how do i establish a mobile connection? Coulnd't find a single code snippet at Google.
© Stack Overflow or respective owner