Android Open Source - QuestCompass Util






From Project

Back to project page QuestCompass.

License

The source code is released under:

Apache License

If you think the Android project QuestCompass 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 de.renard.radar;
//  w  w w .j  a  v  a 2 s  .  co  m
public class Util {
  
  public static String buildDistanceString(final float distanceMeters) {
    float distance = distanceMeters;
    String format;
    String unit;
    if (distanceMeters >= 1000) {
      distance /= 1000;
      unit = "km";
      format = "%,.2f%s";
    } else {
      unit = "m";
      format = "%,.0f%s";
    }
    return String.format(format, distance, unit);
  }

  public static String buildSpeedString(final float speedMPerSecond) {
    float speed = speedMPerSecond * 3.6f;
    String format = "%.1f\n%s";
    String unit = "km/s";
    return String.format(format, speed, unit);
  }

}




Java Source Code List

de.renard.radar.CompassFilter.java
de.renard.radar.CompassSensorListener.java
de.renard.radar.LocationAdapter.java
de.renard.radar.LocationDescriptionDialog.java
de.renard.radar.LocationListDaoGenerator.java
de.renard.radar.LocationListDialog.java
de.renard.radar.RadarActivity.java
de.renard.radar.ScreenOrienationEventListener.java
de.renard.radar.SensorDataController.java
de.renard.radar.Util.java
de.renard.radar.map.LocationOverlay.java
de.renard.radar.map.LocationPickActivity.java
de.renard.radar.views.LocationDeleteInterface.java
de.renard.radar.views.RadarView.java
de.renard.radar.views.RotateView.java