5

I am developing an application where I need to make a connection to a server which is only accessible through a special APN. Therefore, I want to know, is it possible to specify an APN to use for a single connection (or application) only, and use that, possibly even if wifi is active?

Frxstrem
  • 38,761
  • 9
  • 79
  • 119

1 Answers1

1

Firstly, your application will probably need the WRITE_APN_SETTINGS permission in order to be able to make APN changes. You can bring up a UI interface to have the user configure the APN with this code:

Intent intent = new Intent(Settings.ACTION_APN_SETTINGS);
startActivity(intent);

Changing the settings programatically, on the other hand, is a bit more difficult. I recommend you take a look at the answers to this similar question for more information.

Community
  • 1
  • 1
EdoDodo
  • 8,220
  • 3
  • 24
  • 30