Application specific APN

223 views
Skip to first unread message

LH

unread,
Apr 1, 2021, 12:55:57 PMApr 1
to android-platform
Hi all,

Is there a way for an application to specify APN it uses for its mobile data connections? I can create and edit APNs and set the preferred APN. However setting the preferred APN looks to have a global effect, i.e. all apps will use that while my goal is "this app uses that APN while rest use that other APN". And with some APN configurations (e.g. no public Internet access) it seems OS will, in some (OS/OEM specific?) cases, revert to working APN (with public Internet access). 

In case it makes any difference, I have carrier privileges available. And I've tried using various combinations of NetworkCapabilities.TRANSPORT_CELLULAR and NetworkCapabilities.NET_CAPABILITY_ZXY with NetworkRequest. These generally fail with the lack of android.permission.CONNECTIVITY_INTERNAL or android.permission.MAINLINE_NETWORK_STACK.

Thanks!

shail...@gmail.com

unread,
Apr 5, 2021, 10:37:45 AMApr 5
to android-platform
The system uses the MCC and MNC of the sim card to decide the APN to use. So if an incorrect APN is used the sim card will not be able to use mobile data, why do you want to do that?

LH

unread,
Apr 7, 2021, 2:20:05 PMApr 7
to android-platform
On Monday, April 5, 2021 at 5:37:45 PM UTC+3 shail...@gmail.com wrote:
The system uses the MCC and MNC of the sim card to decide the APN to use. So if an incorrect APN is used the sim card will not be able to use mobile data, why do you want to do that?

Perhaps I was a bit too vague; think IMS APN. 
Reply all
Reply to author
Forward
0 new messages