Android Open Source - GreenerGasPedal Sensors






From Project

Back to project page GreenerGasPedal.

License

The source code is released under:

GNU General Public License

If you think the Android project GreenerGasPedal 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 name.nanek.greenerpedal.activity.support;
//  www .j a v  a 2 s .  c  o  m
import name.nanek.greenerpedal.activity.DisplayReadingsActivity;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;

public class Sensors {

  public SensorManager sensorManager;
  
  public Sensor accelerometer;
  
  public Sensor orientationSensor;

  public Sensors(DisplayReadingsActivity displayReadingsActivity, Prefs prefs) {
        sensorManager = (SensorManager) displayReadingsActivity.getSystemService(Context.SENSOR_SERVICE);
        accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
        orientationSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);

    sensorManager.registerListener(displayReadingsActivity, accelerometer, SensorManager.SENSOR_DELAY_UI);
    sensorManager.registerListener(displayReadingsActivity, orientationSensor, SensorManager.SENSOR_DELAY_UI);
  }

  public void unregister(DisplayReadingsActivity displayReadingsActivity) {
    sensorManager.unregisterListener(displayReadingsActivity);
  }

}




Java Source Code List

name.nanek.greenerpedal.GreenerPedalApp.java
name.nanek.greenerpedal.activity.DisplayReadingsActivity.java
name.nanek.greenerpedal.activity.EditPrefsActivity.java
name.nanek.greenerpedal.activity.GraphAndShareActivity.java
name.nanek.greenerpedal.activity.support.APISafeKeyguardHider.java
name.nanek.greenerpedal.activity.support.BitmapUtil.java
name.nanek.greenerpedal.activity.support.LogLine.java
name.nanek.greenerpedal.activity.support.LowPassFilter.java
name.nanek.greenerpedal.activity.support.MessageOnlyFormatter.java
name.nanek.greenerpedal.activity.support.Prefs.java
name.nanek.greenerpedal.activity.support.ScreenLock.java
name.nanek.greenerpedal.activity.support.Sensors.java
name.nanek.greenerpedal.activity.support.ShareUtil.java
name.nanek.greenerpedal.activity.support.Trigger.java
name.nanek.greenerpedal.activity.support.TriggersResult.java
name.nanek.greenerpedal.activity.support.Views.java
name.nanek.greenerpedal.db.model.Reading.java
name.nanek.greenerpedal.db.model.dao.DataHelper.java
name.nanek.greenerpedal.db.model.dao.ReadingDao.java
name.nanek.greenerpedal.db.model.dao.support.DateUtil.java
name.nanek.greenerpedal.db.model.dao.support.DbUtil.java