Android Open Source - lost-phone-tracker-app Boot Receiver






From Project

Back to project page lost-phone-tracker-app.

License

The source code is released under:

MIT License

If you think the Android project lost-phone-tracker-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package at.fhj.ase13.mobcomp2.phonetracker;
/* ww  w  .  ja  va2  s. c  o  m*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BootReceiver extends BroadcastReceiver {

    public BootReceiver() {
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent == null || !Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
            return;
        }

        // if the main activity is disabled (= hidden), the tracking should currently active
        if (!MainActivity.isEnabled(context)) {
            String receiver = new PreferenceManager(context).getReportReceiver();

            if (receiver != null) {
                LogAlarmReceiver.startAlarm(context, receiver);
            }
        }
    }
}




Java Source Code List

at.fhj.ase13.mobcomp2.phonetracker.BootReceiver.java
at.fhj.ase13.mobcomp2.phonetracker.GpsToggler.java
at.fhj.ase13.mobcomp2.phonetracker.LogAlarmReceiver.java
at.fhj.ase13.mobcomp2.phonetracker.MainActivity.java
at.fhj.ase13.mobcomp2.phonetracker.PreferenceManager.java
at.fhj.ase13.mobcomp2.phonetracker.SmsBroadcastReceiver.java
at.fhj.ase13.mobcomp2.phonetracker.SmsLocationReporter.java