-1

Can i get internet if i'm using Access Point for WiFi, i'm using the code

ConnectivityManager mConnectivity =(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
mConnectivity.startUsingNetworkFeature(0, "TYPE_MOBILE");

Thanks

bharath
  • 14,283
  • 16
  • 57
  • 95
Priya R G
  • 543
  • 4
  • 10
  • 21
  • can't get you.What do you mean by access internet.Do you want to connect internet through code ? – Dharmendra Jul 29 '11 at 07:21
  • ya i want to connect internet through code. That is if i'm using an AccessPoint it is not posiible to connect to internet .But i can use the mobile network ie ConnectivityManager.TYPE_MOBILE for accessing the internet.. – Priya R G Jul 29 '11 at 07:35

1 Answers1

0

I think this SO post answers that question in general you can programmatically turn wifi off, which will force the connection to go 3G if available, or you set the network preference from the connectivity manager.

You should be really careful if you are developing a user application, they are not going to appreciate you forcing them to potentially incur 3G charges without notice.

Community
  • 1
  • 1
Idistic
  • 6,281
  • 2
  • 28
  • 38