0

My app sometimes needs to connect via mobile data in order to work. I know there are apps that can make a certain app use only mobile data and I know how I can turn off and on the wifi with my app. But is there a way to tell my app to use mobile connection from now on and at another point remove this restriction?

Aswin P J
  • 546
  • 4
  • 13
Ginso
  • 459
  • 17
  • 33

1 Answers1

0

You can't explicitly force the communications channel on a per-app basis (you can request to use a preferred mode via ConnectivityManager.setNetworkPreference(...), but that's not "forcing").

 // and to be sure:
   ConnectivityManager.setNetworkPreference(ConnectivityManager.TYPE_MOBILE);
Pitty
  • 1,907
  • 5
  • 16
  • 34