use of org.osmdroid.util.GeoPoint in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class MapViewerOsmDroid method loadOcidMarkersByNetwork.
private void loadOcidMarkersByNetwork() {
// Check if OpenCellID data exists and if so load this now
List<CellTowerMarker> items = new LinkedList<>();
String networkOperator = tm.getNetworkOperator();
int currentMmc = 0;
int currentMnc = 0;
if (networkOperator != null && networkOperator.length() > 3) {
currentMmc = Integer.parseInt(networkOperator.substring(0, 3));
currentMnc = Integer.parseInt(networkOperator.substring(3));
}
Drawable cellTowerMarkerIcon = getResources().getDrawable(R.drawable.ic_map_pin_green);
@Cleanup Realm realm = Realm.getDefaultInstance();
RealmResults<Import> importRealmResults = mDbHelper.returnOcidBtsByNetwork(realm, currentMmc, currentMnc).findAll();
for (Import anImport : importRealmResults) {
// CellID,Lac,Mcc,Mnc,Lat,Lng,AvgSigStr,Samples
final int cellID = anImport.getCellId();
final int lac = anImport.getLocationAreaCode();
final int mcc = anImport.getMobileCountryCode();
final int mnc = anImport.getMobileNetworkCode();
final int psc = anImport.getPrimaryScramblingCode();
final String rat = anImport.getRadioAccessTechnology();
final double dLat = anImport.getGpsLocation().getLatitude();
final double dLng = anImport.getGpsLocation().getLongitude();
final GeoPoint location = new GeoPoint(dLat, dLng);
//where is c.getString(6)AvgSigStr
final int samples = anImport.getSamples();
// Add map marker for CellID
CellTowerMarker ovm = new CellTowerMarker(this, mMap, "Cell ID: " + cellID, "", location, new MarkerData(getApplicationContext(), String.valueOf(cellID), String.valueOf(location.getLatitude()), String.valueOf(location.getLongitude()), String.valueOf(lac), String.valueOf(mcc), String.valueOf(mnc), String.valueOf(psc), rat, String.valueOf(samples), false));
ovm.setIcon(cellTowerMarkerIcon);
items.add(ovm);
}
mCellTowerGridMarkerClusterer.addAll(items);
}
use of org.osmdroid.util.GeoPoint in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class MapFragment method loadOcidMarkersByNetwork.
private void loadOcidMarkersByNetwork() {
// Check if OpenCellID data exists and if so load this now
List<CellTowerMarker> items = new LinkedList<>();
String networkOperator = tm.getNetworkOperator();
int currentMmc = 0;
int currentMnc = 0;
if (networkOperator != null && networkOperator.length() > 3) {
currentMmc = Integer.parseInt(networkOperator.substring(0, 3));
currentMnc = Integer.parseInt(networkOperator.substring(3));
}
Drawable cellTowerMarkerIcon = getResources().getDrawable(R.drawable.ic_map_pin_green);
@Cleanup Realm realm = Realm.getDefaultInstance();
RealmResults<Import> importRealmResults = mDbHelper.returnOcidBtsByNetwork(realm, currentMmc, currentMnc).findAll();
for (Import anImport : importRealmResults) {
final int cellID = anImport.getCellId();
final int lac = anImport.getLocationAreaCode();
final int mcc = anImport.getMobileCountryCode();
final int mnc = anImport.getMobileNetworkCode();
final int psc = anImport.getPrimaryScramblingCode();
final String rat = anImport.getRadioAccessTechnology();
final double dLat = anImport.getGpsLocation().getLatitude();
final double dLng = anImport.getGpsLocation().getLongitude();
final GeoPoint location = new GeoPoint(dLat, dLng);
//where is c.getString(6)AvgSigStr
final int samples = anImport.getSamples();
// Add map marker for CellID
CellTowerMarker ovm = new CellTowerMarker(getActivity(), mMap, "Cell ID: " + cellID, "", location, new MarkerData(getContext(), String.valueOf(cellID), String.valueOf(location.getLatitude()), String.valueOf(location.getLongitude()), String.valueOf(lac), String.valueOf(mcc), String.valueOf(mnc), String.valueOf(psc), rat, String.valueOf(samples), false));
ovm.setIcon(cellTowerMarkerIcon);
items.add(ovm);
}
mCellTowerGridMarkerClusterer.addAll(items);
}
Aggregations