Search in sources :

Example 1 with DefaultLocation

use of com.secupwn.aimsicd.data.model.DefaultLocation in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class DefaultDataTransaction method storeDefaultLocation.

private void storeDefaultLocation(Realm realm, int mobileCountryCode, String country, double latitude, double longitude) {
    DefaultLocation location = realm.where(DefaultLocation.class).equalTo("mobileCountryCode", mobileCountryCode).equalTo("country", country).findFirst();
    if (location == null) {
        location = realm.createObject(DefaultLocation.class);
    }
    location.setCountry(country);
    location.setMobileCountryCode(mobileCountryCode);
    if (location.getGpsLocation() == null) {
        location.setGpsLocation(realm.createObject(GpsLocation.class));
    }
    location.getGpsLocation().setLatitude(latitude);
    location.getGpsLocation().setLongitude(longitude);
}
Also used : GpsLocation(com.secupwn.aimsicd.data.model.GpsLocation) DefaultLocation(com.secupwn.aimsicd.data.model.DefaultLocation)

Example 2 with DefaultLocation

use of com.secupwn.aimsicd.data.model.DefaultLocation in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class DefaultLocationAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
        LayoutInflater inflater = LayoutInflater.from(parent.getContext());
        convertView = inflater.inflate(R.layout.default_location_items, parent, false);
        holder = new ViewHolder(convertView);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    final DefaultLocation defaultLocation = getItem(position);
    holder.updateDisplay(defaultLocation, position);
    return convertView;
}
Also used : LayoutInflater(android.view.LayoutInflater) DefaultLocation(com.secupwn.aimsicd.data.model.DefaultLocation)

Aggregations

DefaultLocation (com.secupwn.aimsicd.data.model.DefaultLocation)2 LayoutInflater (android.view.LayoutInflater)1 GpsLocation (com.secupwn.aimsicd.data.model.GpsLocation)1