tags:

views:

55

answers:

1

hi,

How can i use 3G network to run application that makes use of internet. i have make use of wi-fi, but not getting how to set preferance for 3G.

Any help.

here is the code i have used for wifi.

final ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

final android.net.NetworkInfo wifi = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);

Any help that how can i come to know whether 3G is available or not? if(wifi.isAvailable()) { Toast.makeText(Main.this,"Connected to wifi",Toast.LENGTH_SHORT).show(); Intent intent =new Intent (Main.this, Myapplicationclass.class); startActivity(intent); }

                 }
+1  A: 

How can i use 3G network to run application that makes use of internet. i have make use of wi-fi, but not getting how to set preferance for 3G.

You do not control this. The user and the operating system control this. If WiFi is enabled and there is a configured access point within range, the device will use WiFi, not 3G.

CommonsWare