Tabnine Logo
Value.asFloat
Code IndexAdd Tabnine to your IDE (free)

How to use
asFloat
method
in
com.google.android.gms.fitness.data.Value

Best Java code snippets using com.google.android.gms.fitness.data.Value.asFloat (Showing top 2 results out of 315)

origin: IBM/android-kubernetes-blockchain

  totalStepsFromDataPoints += dp.getValue(field).asInt();
} else if (field.getName().equals("distance")) {
  distanceTraveledFromDataPoints += dp.getValue(field).asFloat();
origin: patloew/RxFit

private void onBucketLoaded(Bucket bucket) {
  FitnessSessionData fitnessSessionData = new FitnessSessionData();
  fitnessSessionData.name = bucket.getSession().getName();
  fitnessSessionData.appName = bucket.getSession().getAppPackageName();
  fitnessSessionData.activity = bucket.getSession().getActivity();
  fitnessSessionData.start = new Date(bucket.getSession().getStartTime(TimeUnit.MILLISECONDS));
  fitnessSessionData.end = new Date(bucket.getSession().getEndTime(TimeUnit.MILLISECONDS));
  if(bucket.getDataSet(DataType.AGGREGATE_STEP_COUNT_DELTA).getDataPoints().isEmpty()) {
    fitnessSessionData.steps = 0;
  } else {
    fitnessSessionData.steps = bucket.getDataSet(DataType.AGGREGATE_STEP_COUNT_DELTA).getDataPoints().get(0).getValue(Field.FIELD_STEPS).asInt();
  }
  if(bucket.getDataSet(DataType.AGGREGATE_CALORIES_EXPENDED).getDataPoints().isEmpty()) {
    fitnessSessionData.calories = 0;
  } else {
    fitnessSessionData.calories = (int) bucket.getDataSet(DataType.AGGREGATE_CALORIES_EXPENDED).getDataPoints().get(0).getValue(Field.FIELD_CALORIES).asFloat();
  }
  fitnessSessionDataList.add(fitnessSessionData);
}
com.google.android.gms.fitness.dataValueasFloat

Popular methods of Value

  • asInt
  • setFloat
  • setActivity
  • setInt

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • ImageIO (javax.imageio)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now