com.stringsandints.inventium.khlrooster.services
Class AlarmClockService

java.lang.Object
  extended by Service
      extended by com.stringsandints.inventium.khlrooster.services.AlarmClockService

public class AlarmClockService
extends Service


Field Summary
private static int ACCELEROMETER_THRESHOLD
           
private static AlarmClockService instance
           
private  Sensor mAccelerometer
           
private  MediaPlayer mediaplayer
           
private  SensorManager mSensorManager
           
private  Vibrator vibrator
           
 
Constructor Summary
AlarmClockService()
           
 
Method Summary
static AlarmClockService getInstance()
           
 void onAccuracyChanged(Sensor sensor, int accuracy)
           
 IBinder onBind(Intent arg0)
           
 void onCreate()
           
 void onDestroy()
           
 void onSensorChanged(SensorEvent event)
          This method stops the alarm if the values of the accelerometer get above a certain value.
 void onStart(Intent intent, int startId)
           
 void stopAlarm()
          This method stops the sound from playing, stops the accelerometer giving data and closes the activity with the cancelbutton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mediaplayer

private MediaPlayer mediaplayer

mSensorManager

private SensorManager mSensorManager

mAccelerometer

private Sensor mAccelerometer

ACCELEROMETER_THRESHOLD

private static int ACCELEROMETER_THRESHOLD

vibrator

private Vibrator vibrator

instance

private static AlarmClockService instance
Constructor Detail

AlarmClockService

public AlarmClockService()
Method Detail

getInstance

public static AlarmClockService getInstance()

onDestroy

public void onDestroy()

onBind

public IBinder onBind(Intent arg0)

onCreate

public void onCreate()

onStart

public void onStart(Intent intent,
                    int startId)

onAccuracyChanged

public void onAccuracyChanged(Sensor sensor,
                              int accuracy)

onSensorChanged

public void onSensorChanged(SensorEvent event)
This method stops the alarm if the values of the accelerometer get above a certain value. The device displays a message to the user when the alarm is deactivated.


stopAlarm

public void stopAlarm()
This method stops the sound from playing, stops the accelerometer giving data and closes the activity with the cancelbutton.