public static List<Apn> query(Context context){
  String[] simCodes=getSimOperatorCodes(context);
  String[] networkCodes=getNetworkOperatorCodes(context);
  Set<Apn> resultSet=new HashSet<>();
  resultSet.addAll(query(context,simCodes[0],simCodes[1]));
  resultSet.addAll(query(context,networkCodes[0],networkCodes[1]));
  List<Apn> result=new ArrayList<>(resultSet.size());
  result.addAll(resultSet);
  return result;
}

public static List < Apn > query ( Context context ) { String [ ] simCodes = getSimOperatorCodes ( context ) ; String [ ] networkCodes = getNetworkOperatorCodes ( context ) ; Set < Apn > resultSet = new HashSet < > ( ) ; resultSet . addAll ( query ( context , simCodes [ 0 ] , simCodes [ 1 ] ) ) ; resultSet . addAll ( query ( context , networkCodes [ 0 ] , networkCodes [ 1 ] ) ) ; List < Apn > result = new ArrayList < > ( resultSet . size ( ) ) ; result . addAll ( resultSet ) ; return result ; }
query for apns using mcc and mnc codes found on the sim card or in the network settings .
