Android Open Source - SensorsWebLogger My Receiver






From Project

Back to project page SensorsWebLogger.

License

The source code is released under:

GNU General Public License

If you think the Android project SensorsWebLogger 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 org.kost.android.sensorsweblogger;
/* ww w . j a v a2s .c  o  m*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;

public class MyReceiver extends BroadcastReceiver {
    public MyReceiver() {
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        SharedPreferences sharedPrefs = context.getSharedPreferences(context.getPackageName() + "_preferences", Context.MODE_PRIVATE);

        if (sharedPrefs.getBoolean("pref_on_boot",true)) {
            Intent myIntent = new Intent(context, MainService.class);
            context.startService(myIntent);
        }
    }
}




Java Source Code List

org.kost.android.sensorsweblogger.ApplicationTest.java
org.kost.android.sensorsweblogger.BestLastLocation.java
org.kost.android.sensorsweblogger.HandleSensors.java
org.kost.android.sensorsweblogger.MainActivity.java
org.kost.android.sensorsweblogger.MainService.java
org.kost.android.sensorsweblogger.MyReceiver.java
org.kost.android.sensorsweblogger.SendSensorData.java
org.kost.android.sensorsweblogger.SensorAmbientTemperature.java
org.kost.android.sensorsweblogger.SensorLight.java
org.kost.android.sensorsweblogger.SensorPressure.java
org.kost.android.sensorsweblogger.SensorRelativeHumidity.java
org.kost.android.sensorsweblogger.SettingsActivity.java
org.kost.android.sensorsweblogger.TemplateSensor.java