GsmCellLocation gsmCellLocation = (GsmCellLocation) cellLocation; CellIdentityGsm identity = CellIdentityGsm.class.getConstructor(int.class, int.class, int.class, int.class) .newInstance(getMcc(), getMnc(), gsmCellLocation.getLac(), gsmCellLocation.getCid()); CellSignalStrengthGsm strength = CellSignalStrengthGsm.class.newInstance(); CellInfoGsm info = CellInfoGsm.class.newInstance();
private Cell parseCellInfo(NeighboringCellInfo info) { try { if (getCellType(info.getNetworkType()) != Cell.CellType.GSM) return null; return new Cell(Cell.CellType.GSM, getMcc(), getMnc(), info.getLac(), info.getCid(), info.getPsc(), info.getRssi()); } catch (Exception ignored) { } return null; }