List of usage examples for android.hardware SensorEvent toString
public String toString()
From source file:alaindc.crowdroid.SensorsIntentService.java
public final void onSensorChanged(SensorEvent event) { Log.d("SENSORS_INTENTSERVICE", event.toString()); // Hack Reduce updates if (random.nextInt(10) < 9) return;//from w ww . ja v a2 s .co m SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(Constants.PREF_FILE, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPref.edit(); editor.putString(Constants.PREF_SENSOR_ + event.sensor.getType(), Float.toString(event.values[0])); editor.commit(); // Update view Intent senseintent = new Intent(Constants.INTENT_UPDATE_SENSORS); senseintent.putExtra(Constants.INTENT_RECEIVED_DATA_EXTRA_DATA, "Sensor " + Constants.getNameOfSensor(event.sensor.getType()) + " value: " + Float.toString(event.values[0])); LocalBroadcastManager.getInstance(this).sendBroadcast(senseintent); }