Application specific APN

classic Classic list List threaded Threaded
3 messages Options
LH
Reply | Threaded
Open this post in threaded view
|

Application specific APN

LH
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!

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/f9776c28-d02c-4d80-92ce-9dfab0a18388n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Application specific APN

Shailan Patel
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?
On Thursday, April 1, 2021 at 5:55:57 PM UTC+1 LH wrote:
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!

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/f4c680e7-fa33-41d7-bfb2-587454efc62cn%40googlegroups.com.
LH
Reply | Threaded
Open this post in threaded view
|

Re: Application specific APN

LH
On Monday, April 5, 2021 at 5:37:45 PM UTC+3 [hidden email] 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. 
 
On Thursday, April 1, 2021 at 5:55:57 PM UTC+1 LH wrote:
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!

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/2f44e16d-ce37-45e3-ba52-11af6a8bdc65n%40googlegroups.com.