Search in sources :

Example 1 with ShakeDetector

use of com.squareup.seismic.ShakeDetector in project SharedPreferenceInspector by PrashamTrivedi.

the class DemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demo);
    SharedPreferences defualtPref = PreferenceManager.getDefaultSharedPreferences(this);
    defualtPref.edit().putString("Test", "Done").apply();
    SharedPreferences anotherPref = getSharedPreferences("Prasham", MODE_PRIVATE);
    anotherPref.edit().putString("Test", "Love you life").apply();
    anotherPref.edit().putInt("Test Int", 1138).apply();
    anotherPref.edit().putFloat("Test Float", 11.38F).apply();
    anotherPref.edit().putLong("Test Long", 113834).apply();
    anotherPref.edit().putBoolean("Test Boolean", true).apply();
    SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
    ShakeDetector sd = new ShakeDetector(this);
    sd.start(sensorManager);
}
Also used : SensorManager(android.hardware.SensorManager) SharedPreferences(android.content.SharedPreferences) ShakeDetector(com.squareup.seismic.ShakeDetector)

Aggregations

SharedPreferences (android.content.SharedPreferences)1 SensorManager (android.hardware.SensorManager)1 ShakeDetector (com.squareup.seismic.ShakeDetector)1