Search in sources :

Example 1 with RealmHelper

use of com.secupwn.aimsicd.utils.RealmHelper in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class MapViewerOsmDroid method onCreate.

/**
     * Called when the activity is first created.
     */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    log.info("Starting MapViewer");
    setUpMapIfNeeded();
    mDbHelper = new RealmHelper(this);
    tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    // Bind to LocalService
    Intent intent = new Intent(this, AimsicdService.class);
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
    TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    tm.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CELL_LOCATION | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE);
}
Also used : RealmHelper(com.secupwn.aimsicd.utils.RealmHelper) TelephonyManager(android.telephony.TelephonyManager) Intent(android.content.Intent)

Example 2 with RealmHelper

use of com.secupwn.aimsicd.utils.RealmHelper in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class AdvancedUserSmsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    realm = Realm.getDefaultInstance();
    dbaccess = new RealmHelper(getApplicationContext());
    RealmResults<SmsData> msgitems = realm.where(SmsData.class).findAllSorted("timestamp");
    listViewAdv.setAdapter(new SmsDataAdapter(getApplicationContext(), msgitems));
    listViewAdv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> a, View v, int position, long id) {
            final SmsData smsData = (SmsData) listViewAdv.getItemAtPosition(position);
            realm.executeTransaction(new Realm.Transaction() {

                @Override
                public void execute(Realm realm) {
                    smsData.deleteFromRealm();
                }
            });
            Toast.makeText(a.getContext(), "Deleted Sms", LENGTH_SHORT).show();
            return true;
        }
    });
}
Also used : SmsDataAdapter(com.secupwn.aimsicd.data.adapter.SmsDataAdapter) InjectView(io.freefair.android.injection.annotation.InjectView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) RealmHelper(com.secupwn.aimsicd.utils.RealmHelper) SmsData(com.secupwn.aimsicd.data.model.SmsData) AdapterView(android.widget.AdapterView) Realm(io.realm.Realm)

Example 3 with RealmHelper

use of com.secupwn.aimsicd.utils.RealmHelper in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class MapFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    log.info("Starting MapViewer");
    setUpMapIfNeeded();
    mDbHelper = new RealmHelper(getActivity());
    tm = (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
    // Bind to LocalService
    Intent intent = new Intent(getActivity(), AimsicdService.class);
    getActivity().bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
    TelephonyManager tm = (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
    tm.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CELL_LOCATION | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE);
}
Also used : RealmHelper(com.secupwn.aimsicd.utils.RealmHelper) TelephonyManager(android.telephony.TelephonyManager) Intent(android.content.Intent)

Example 4 with RealmHelper

use of com.secupwn.aimsicd.utils.RealmHelper in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class DbViewerFragment method onAttach.

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    mDb = new RealmHelper(activity.getBaseContext());
}
Also used : RealmHelper(com.secupwn.aimsicd.utils.RealmHelper)

Aggregations

RealmHelper (com.secupwn.aimsicd.utils.RealmHelper)4 Intent (android.content.Intent)2 TelephonyManager (android.telephony.TelephonyManager)2 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 SmsDataAdapter (com.secupwn.aimsicd.data.adapter.SmsDataAdapter)1 SmsData (com.secupwn.aimsicd.data.model.SmsData)1 InjectView (io.freefair.android.injection.annotation.InjectView)1 Realm (io.realm.Realm)1