Search code examples
androidapn

How to get Access Point Name programmatically


I'm trying to get Access Point Name programmatically.I need this to develop application for the specific APN name.I googled lot but didn't find any proper way can any tell me how to do this.Thanks


Solution

  • For Selected APN:

    Cursor c = context.getContentResolver().query(Uri.parse("content://telephony/carriers/preferapn"), null, null, null, null);
    

    For All APN Names:

    Cursor c = context.getContentResolver().query(Uri.parse("content://telephony/carriers/current"), null, null, null, null);