Android Open Source - trip-chain-android Activity






From Project

Back to project page trip-chain-android.

License

The source code is released under:

MIT License

If you think the Android project trip-chain-android 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 fi.aalto.tripchain.route;
//from w w  w.  j ava 2  s .c  o  m
import com.google.android.gms.location.DetectedActivity;


/**
 * Maps Play Service DetectedActivities to strings.
 * @author juke
 *
 */
public enum Activity {
  IN_VEHICLE("in-vehicle"), 
  ON_FOOT("on-foot"),
  STILL("still"), 
  UNKNOWN("unknown"), 
  ON_BICYCLE("on-bicycle"), 
  TILTING("tilting");
    
  private final String name;
   
  private Activity(String name) {
    this.name = name;
  }
  
  @Override 
  public String toString() {
    return this.name;
  }
  
  public static Activity getActivity(DetectedActivity da) {
      Activity activity = Activity.UNKNOWN;
      switch (da.getType()) {
      case DetectedActivity.IN_VEHICLE:
        activity = Activity.IN_VEHICLE;
        break;
      case DetectedActivity.ON_BICYCLE:
        activity = Activity.ON_BICYCLE;
        break;
      case DetectedActivity.ON_FOOT:
        activity = Activity.ON_FOOT;
        break;
      case DetectedActivity.STILL:
        activity = Activity.STILL;
        break;
      case DetectedActivity.TILTING:
        activity = Activity.TILTING;
        break;
      }
      
      return activity;
  }
}




Java Source Code List

fi.aalto.tripchain.BackgroundService.java
fi.aalto.tripchain.Configuration.java
fi.aalto.tripchain.LoginActivity.java
fi.aalto.tripchain.MainActivity.java
fi.aalto.tripchain.StartFragment.java
fi.aalto.tripchain.TripFragment.java
fi.aalto.tripchain.receivers.ActivityReceiver.java
fi.aalto.tripchain.receivers.EventDispatcher.java
fi.aalto.tripchain.receivers.EventListener.java
fi.aalto.tripchain.receivers.LocationReceiver.java
fi.aalto.tripchain.receivers.Receiver.java
fi.aalto.tripchain.route.ActivityListener.java
fi.aalto.tripchain.route.Activity.java
fi.aalto.tripchain.route.LocationListener.java
fi.aalto.tripchain.route.RoadSegment.java
fi.aalto.tripchain.route.Roads.java
fi.aalto.tripchain.route.RouteSegment.java
fi.aalto.tripchain.route.Route.java
fi.aalto.tripchain.route.TripRecorder.java
fi.aalto.tripchain.route.Trip.java