Пример #1
0
 public Tower(JSONObject jsonObject) {
   try {
     setLocationAreaCode(Integer.parseInt(jsonObject.getString("lac")));
   } catch (JSONException e) {
   }
   try {
     setCellId(Integer.parseInt(jsonObject.getString("cid")));
   } catch (JSONException e) {
   }
   try {
     JSONObject location = jsonObject.getJSONObject("location");
     setLatLng(new LatLng(location.getDouble("Latitude"), location.getDouble("Longitude")));
   } catch (JSONException e) {
   }
   try {
     setRssi(Integer.parseInt(jsonObject.getString("signal")));
   } catch (JSONException e) {
   }
   try {
     setBts(jsonObject.getString("bts"));
   } catch (JSONException e) {
   }
   try {
     setId(jsonObject.getString("_id"));
   } catch (JSONException e) {
   }
   try {
     setOperator(jsonObject.getString("operator"));
   } catch (JSONException e) {
   }
   setTime(GeneralUtils.getCurrentTime());
   setNeighbor(false);
 }
Пример #2
0
 public Tower(NeighboringCellInfo cellTowerInfo) {
   setLocationAreaCode(cellTowerInfo.getLac());
   setCellId(cellTowerInfo.getCid());
   setSignalStrength(cellTowerInfo.getRssi());
   setRssi(cellTowerInfo.getRssi());
   setPrimaryScrambleCode(cellTowerInfo.getPsc());
   setNetworkType(cellTowerInfo.getNetworkType());
   setTime(GeneralUtils.getCurrentTime());
   setNeighbor(true);
 }
Пример #3
0
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public Tower(CellInfoCdma cellInfoCdma) {
   setLocationAreaCode(cellInfoCdma.getCellIdentity().getNetworkId());
   setCellId(cellInfoCdma.getCellIdentity().getSystemId());
   setSignalStrength(cellInfoCdma.getCellSignalStrength().getLevel());
   setRssi(cellInfoCdma.getCellSignalStrength().getCdmaDbm());
   setPrimaryScrambleCode(cellInfoCdma.getCellIdentity().getSystemId());
   setNetworkType(cellInfoCdma.getCellIdentity().getBasestationId());
   setLatLng(
       new LatLng(
           cellInfoCdma.getCellIdentity().getLatitude(),
           cellInfoCdma.getCellIdentity().getLongitude()));
   setTime(GeneralUtils.getCurrentTime());
   setNeighbor(false);
 }