Set APN programmatically on Android

前端 未结 3 837
无人共我
无人共我 2020-12-09 21:15

In my Android application I would like get all the available APNs and check if the client APN is available. I would like to run my app using this client APN.

Is ther

3条回答
  •  难免孤独
    2020-12-09 21:43

    This might not answer your question directly. Have a look at this . Though keep in mind that this code is for reference only and should not be used in your app.

    To get defined APN:

    Cursor c = getContentResolver().query(Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current"), null, null, null, null);
    

    And then refer to Telephony.Carriers for relevant columns.

提交回复
热议问题