Android Open Source - Rejsekort-Reminder Waiting Mode

From Project

Back to project page Rejsekort-Reminder.


The source code is released under:

GNU General Public License

If you think the Android project Rejsekort-Reminder 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 com.example.publictransportation.modes;
//  w  w  w  .  j  av  a2  s  .  c om
import com.example.publictransportation.profiles.AbstractProfile;
import com.example.publictransportation.sensors.AbstractSensor;
import com.example.publictransportation.sensors.ActivitySensor;
import com.example.publictransportation.service.IModeManager;

public class WaitingMode extends AbstractMode {

  int notStill = 0;
  final int NOT_STILL_LIMIT = 1; 

  public WaitingMode(AbstractProfile profile, IModeManager manager) {
    super(profile, manager, "");

    AbstractSensor activitySensor = new ActivitySensor(this, profile.getLowFrequencyDelay(), profile.getLowActivitySensorCutoff());

  public void input(AbstractSensor sensor, String data) {
    if (!data.equals(ActivitySensor.STILL)) {      
        notStill += 1;

    // always end with call to evaluate()

  protected void evaluate() {
    if(notStill >= NOT_STILL_LIMIT) {
      changeMode(ModeTypes.DEFAULT, "");


  public ModeTypes getType() {
    return ModeTypes.WAITING;


Java Source Code List