B4A Library GoogleFit(ness) Client

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Jan 13, 2019.

  1. DonManfred

    DonManfred Expert Licensed User

    GoogleFitness

    Author: DonManfred
    Version: 0.08
    • Bucket
      • Functions:
        • getDataSet (arg0 As com.google.android.gms.fitness.data.DataType) As com.google.android.gms.fitness.data.DataSet
        • getEndTime (arg0 As java.util.concurrent.TimeUnit) As Long
        • getStartTime (unit As java.util.concurrent.TimeUnit) As Long
        • Initialize (EventName As String)
        • IsInitialized As Boolean
      • Properties:
        • BucketActivity As String [read only]
        • BucketType As Int [read only]
        • DataSets As java.util.List [read only]
    • DataPoint
      • Functions:
        • getEndTime (unit As java.util.concurrent.TimeUnit) As Long
        • getStartTime (unit As java.util.concurrent.TimeUnit) As Long
        • getTimestamp (unit As java.util.concurrent.TimeUnit) As Long
        • getValue (fld As com.google.android.gms.fitness.data.Field) As com.google.android.gms.fitness.data.Value
        • Initialize (EventName As String, dp As com.google.android.gms.fitness.data.DataPoint)
        • IsInitialized As Boolean
      • Properties:
        • DataSource As com.google.android.gms.fitness.data.DataSource [read only]
        • DataType As com.google.android.gms.fitness.data.DataType [read only]
    • DataReadRequestBuilder
      • Functions:
        • addFilteredDataQualityStandard (arg0 As Int) As DataReadRequestBuilder
        • aggregate (arg0 As com.google.android.gms.fitness.data.DataType, arg1 As com.google.android.gms.fitness.data.DataType) As DataReadRequestBuilder
        • bucketByActivitySegment (segment As Int, unit As java.util.concurrent.TimeUnit) As DataReadRequestBuilder
        • bucketByActivitySegment2 (segment As Int, unit As java.util.concurrent.TimeUnit, source As com.google.android.gms.fitness.data.DataSource) As DataReadRequestBuilder
        • bucketByActivityType (segment As Int, unit As java.util.concurrent.TimeUnit) As DataReadRequestBuilder
        • bucketByActivityType2 (segment As Int, unit As java.util.concurrent.TimeUnit, source As com.google.android.gms.fitness.data.DataSource) As DataReadRequestBuilder
        • bucketBySession (session As Int, unit As java.util.concurrent.TimeUnit) As DataReadRequestBuilder
        • bucketByTime (amount As Int, unit As java.util.concurrent.TimeUnit) As DataReadRequestBuilder
        • build As com.google.android.gms.fitness.request.DataReadRequest
        • Initialize (EventName As String) As DataReadRequestBuilder
        • setTimeRange (starttime As Long, endtime As Long, unit As java.util.concurrent.TimeUnit) As DataReadRequestBuilder
      • Properties:
        • df As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ACCURACY As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ACTIVITY As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ACTIVITY_CONFIDENCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ALTITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_AVERAGE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_BPM As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_CALORIES As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_CIRCUMFERENCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_CONFIDENCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_DISTANCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_DURATION As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_EXERCISE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_FOOD_ITEM As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_HEIGHT As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_HIGH_LATITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_HIGH_LONGITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LATITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LONGITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LOW_LATITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LOW_LONGITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_MAX As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_MEAL_TYPE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_MIN As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_NUM_SEGMENTS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_NUTRIENTS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_OCCURRENCES As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_REPETITIONS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_RESISTANCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_RESISTANCE_TYPE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_REVOLUTIONS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_RPM As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_SPEED As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_STEP_LENGTH As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_STEPS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_VOLUME As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_WATTS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_WEIGHT As com.google.android.gms.fitness.data.Field [read only]
        • dtAGGREGATE_ACTIVITY_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_BASAL_METABOLIC_RATE_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_BODY_FAT_PERCENTAGE_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_CALORIES_CONSUMED As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_CALORIES_EXPENDED As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_DISTANCE_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_HEART_RATE_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_HEIGHT_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_HYDRATION As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_INPUT_TYPES As java.util.Set [read only]
        • dtAGGREGATE_LOCATION_BOUNDING_BOX As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_NUTRITION_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_POWER_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_SPEED_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_STEP_COUNT_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_WEIGHT_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_ACTIVITY_SAMPLE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_ACTIVITY_SAMPLES As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_ACTIVITY_SEGMENT As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_BASAL_METABOLIC_RATE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_BODY_FAT_PERCENTAGE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CALORIES_EXPENDED As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_PEDALING_CADENCE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_PEDALING_CUMULATIVE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_WHEEL_REVOLUTION As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_WHEEL_RPM As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_DISTANCE_CUMULATIVE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_DISTANCE_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_HEART_RATE_BPM As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_HEIGHT As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_LOCATION_SAMPLE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_LOCATION_TRACK As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_POWER_SAMPLE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_SPEED As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_STEP_COUNT_CADENCE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_STEP_COUNT_CUMULATIVE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_STEP_COUNT_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_WEIGHT As com.google.android.gms.fitness.data.DataType [read only]
        • tuDAYS As java.util.concurrent.TimeUnit [read only]
        • tuHOURS As java.util.concurrent.TimeUnit [read only]
        • tuMICROSECONDS As java.util.concurrent.TimeUnit [read only]
        • tuMILLISECONDS As java.util.concurrent.TimeUnit [read only]
        • tuNANOSECONDS As java.util.concurrent.TimeUnit [read only]
        • tuSECONDS As java.util.concurrent.TimeUnit [read only]
        • tuX As java.util.concurrent.TimeUnit [read only]
    • DataReadResponse
      • Functions:
        • createDataPoint (datasource As com.google.android.gms.fitness.data.DataSource) As com.google.android.gms.fitness.data.DataSet
        • getDataSource (datatype As com.google.android.gms.fitness.data.DataType) As com.google.android.gms.fitness.data.DataSet
        • Initialize (EventName As String, resp As com.google.android.gms.fitness.result.DataReadResponse)
        • IsInitialized As Boolean
      • Properties:
        • DataPoints As List [read only]
        • DataType As com.google.android.gms.common.api.Status [read only]
        • Result As com.google.android.gms.fitness.result.DataReadResult [write only]
    • DataSet
      • Functions:
        • addDatapoint (data As com.google.android.gms.fitness.data.DataPoint)
        • createDataPoint As com.google.android.gms.fitness.data.DataPoint
        • Initialize (EventName As String)
        • IsInitialized As Boolean
      • Properties:
        • DataPoints As java.util.List [read only]
        • DataSource As com.google.android.gms.fitness.data.DataSource [read only]
        • DataType As com.google.android.gms.fitness.data.DataType [read only]
        • IsEmpty As Boolean [read only]
    • Field
      • Functions:
        • Initialize (fld As com.google.android.gms.fitness.data.Field)
        • IsInitialized As Boolean
      • Properties:
        • Format As Int [read only]
        • Name As String [read only]
    • FitnessClient
      • Events:
        • DataRead (successful As Boolean, response As DataReadResponse)
        • onAccount (successful As Boolean)
        • onDataPoint (dp As DataPoint)
      • Functions:
        • AddSensorRequest (sensortype As com.google.android.gms.fitness.data.DataType, amount As Long, unit As java.util.concurrent.TimeUnit)
        • dumpDataSet (dataSet As com.google.android.gms.fitness.data.DataSet)
        • Initialize (EventName As String)
        • listSubscriptions (datatype As com.google.android.gms.fitness.data.DataType)
        • readDailyTotal (datatype As com.google.android.gms.fitness.data.DataType)
        • readDailyTotalFromLocalDevice (datatype As com.google.android.gms.fitness.data.DataType)
        • readData (readRequest As com.google.android.gms.fitness.request.DataReadRequest)
        • Subscribe (datatype As com.google.android.gms.fitness.data.DataType)
        • test
        • UnSubscribe (datatype As com.google.android.gms.fitness.data.DataType)
    • SensorRequestBuilder
      • Functions:
        • build As com.google.android.gms.fitness.request.SensorRequest
        • Initialize (EventName As String) As SensorRequestBuilder
        • setAccuracyMode (accuracy As Int) As SensorRequestBuilder
        • setDataSource (ds As com.google.android.gms.fitness.data.DataSource) As SensorRequestBuilder
        • setDataType (datatype As com.google.android.gms.fitness.data.DataType) As SensorRequestBuilder
        • setFastestRate (rate As Int, unit As java.util.concurrent.TimeUnit) As SensorRequestBuilder
        • setMaxDeliveryLatency (latency As Int, unit As java.util.concurrent.TimeUnit) As SensorRequestBuilder
        • setSamplingRate (rate As Int, unit As java.util.concurrent.TimeUnit) As SensorRequestBuilder
        • setTimeout (timeout As Int, unit As java.util.concurrent.TimeUnit) As SensorRequestBuilder
      • Properties:
        • df As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ACCURACY As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ACTIVITY As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ACTIVITY_CONFIDENCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_ALTITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_AVERAGE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_BPM As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_CALORIES As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_CIRCUMFERENCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_CONFIDENCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_DISTANCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_DURATION As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_EXERCISE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_FOOD_ITEM As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_HEIGHT As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_HIGH_LATITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_HIGH_LONGITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LATITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LONGITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LOW_LATITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_LOW_LONGITUDE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_MAX As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_MEAL_TYPE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_MIN As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_NUM_SEGMENTS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_NUTRIENTS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_OCCURRENCES As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_REPETITIONS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_RESISTANCE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_RESISTANCE_TYPE As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_REVOLUTIONS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_RPM As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_SPEED As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_STEP_LENGTH As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_STEPS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_VOLUME As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_WATTS As com.google.android.gms.fitness.data.Field [read only]
        • dfFIELD_WEIGHT As com.google.android.gms.fitness.data.Field [read only]
        • dtAGGREGATE_BASAL_METABOLIC_RATE_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_BODY_FAT_PERCENTAGE_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_CALORIES_CONSUMED As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_CALORIES_EXPENDED As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_DISTANCE_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_HEART_RATE_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_HEIGHT_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_HYDRATION As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_INPUT_TYPES As java.util.Set [read only]
        • dtAGGREGATE_LOCATION_BOUNDING_BOX As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_NUTRITION_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_POWER_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_SPEED_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_STEP_COUNT_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtAGGREGATE_WEIGHT_SUMMARY As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_ACTIVITY_SAMPLE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_ACTIVITY_SAMPLES As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_ACTIVITY_SEGMENT As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_BASAL_METABOLIC_RATE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_BODY_FAT_PERCENTAGE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CALORIES_EXPENDED As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_PEDALING_CADENCE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_PEDALING_CUMULATIVE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_WHEEL_REVOLUTION As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_CYCLING_WHEEL_RPM As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_DISTANCE_CUMULATIVE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_DISTANCE_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_HEART_RATE_BPM As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_HEIGHT As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_LOCATION_SAMPLE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_LOCATION_TRACK As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_POWER_SAMPLE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_SPEED As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_STEP_COUNT_CADENCE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_STEP_COUNT_CUMULATIVE As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_STEP_COUNT_DELTA As com.google.android.gms.fitness.data.DataType [read only]
        • dtTYPE_WEIGHT As com.google.android.gms.fitness.data.DataType [read only]
        • tuDAYS As java.util.concurrent.TimeUnit [read only]
        • tuHOURS As java.util.concurrent.TimeUnit [read only]
        • tuMICROSECONDS As java.util.concurrent.TimeUnit [read only]
        • tuMILLISECONDS As java.util.concurrent.TimeUnit [read only]
        • tuNANOSECONDS As java.util.concurrent.TimeUnit [read only]
        • tuSECONDS As java.util.concurrent.TimeUnit [read only]
        • tuX As java.util.concurrent.TimeUnit [read only]
    • Session
      • Functions:
        • getActiveTime (unit As java.util.concurrent.TimeUnit) As Long
        • getEndTime (unit As java.util.concurrent.TimeUnit) As Long
        • getMimeType (arg0 As String) As String
        • getStartTime (unit As java.util.concurrent.TimeUnit) As Long
        • Initialize (session As com.google.android.gms.fitness.data.Session)
        • IsInitialized As Boolean
      • Properties:
        • AppPackageName As String [read only]
        • Description As String [read only]
        • hasActiveTime As Boolean [read only]
        • Ongoing As Boolean [read only]
        • SessionActivity As String [read only]
    • SessionBuilder
      • Functions:
        • build As com.google.android.gms.fitness.data.Session
        • Initialize (EventName As String) As SessionBuilder
        • setActiveTime (time As Long, unit As java.util.concurrent.TimeUnit) As SessionBuilder
        • setDescription (description As String) As SessionBuilder
        • setEndTime (time As Long, unit As java.util.concurrent.TimeUnit) As SessionBuilder
        • setIdentifier (identifier As String) As SessionBuilder
        • setName (name As String) As SessionBuilder
        • setSessionActivity (sessionActivity As String) As SessionBuilder
        • setStartTime (time As Long, unit As java.util.concurrent.TimeUnit) As SessionBuilder

    Setup:
    Add to your Main module
    Code:
    #AdditionalJar: com.google.android.gms:play-services-fitness
    #AdditionalJar: com.google.android.gms:play-services-auth
    Examplecode

    Code:
    Sub Globals
        
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
        Dim fc As FitnessClient
        
    Private btnLogin As Button
        
    Dim req As DataReadRequestBuilder
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
        
    'Do not forget to load the layout file created with the visual designer. For example:
        Activity.LoadLayout("Layout1")
        
    'Log(DateTime.DeviceDefaultDateFormat)
        'DateTime.DateFormat ="dd.MM.yyyy"
    End Sub
    Sub Activity_Resume
        
    Dim si As Intent = Activity.GetStartingIntent
        
    If si <> Null Then
            
    Log(si.ExtrasToString)
        
    End If
    End Sub
    Sub Activity_Pause (UserClosed As Boolean)
    End Sub

    Sub btnLogin_Click
        fc.Initialize(
    "Fitness")
    End Sub
    Sub Fitness_onAccount(successful As Boolean)
        
    Log($"Fitness_onAccount(${successful})"$)
        
    Dim oldformat As String = DateTime.DeviceDefaultDateFormat
        
    DateTime.DateFormat = "dd.MM.YYYY"
        
    Dim begintime As Long = DateTime.DateTimeParse("01.01.2018","00:00:00")
        
    Dim endtime As Long = DateTime.Now
        
    Log("BeginTime = "&begintime)
        
    Log("  EndTime = "&endtime)
        req.Initialize(
    "Fitness").bucketByTime(1,req.tuDAYS).aggregate(req.dtAGGREGATE_STEP_COUNT_DELTA,req.dtAGGREGATE_STEP_COUNT_DELTA).setTimeRange(begintime,endtime,req.tuMILLISECONDS)
        fc.readData(req.build)
        
        
    DateTime.DateFormat = oldformat
        
        
    'fc.Subscribe(req.dtTYPE_STEP_COUNT_DELTA) ' One need to register for step cound
        'fc.listSubscriptions(req.dtTYPE_STEP_COUNT_DELTA) ' see list on data suibscribed
        
        
    End Sub
    Sub Fitness_DataRead(successful As Boolean, response As DataReadResponse)
        
    Log($"Fitness_DataRead(${successful},${response})"$)
        
    'Log(response.DataType)
        If response.DataPoints <> Null Then
            
    Log(response.DataPoints.Size)
            
    If response.DataPoints.Size > 0 Then
                
    Dim l As List = response.DataPoints
                
    For i = 0 To l.Size-1
                    
    Dim bucket As Bucket = l.Get(i)
                    
    Log(bucket)
                    
    Log($"$date{bucket.getStartTime(req.tuMILLISECONDS)} $time{bucket.getStartTime(req.tuMILLISECONDS)} - $time{bucket.getEndTime(req.tuMILLISECONDS)}  }"$)
                    
    Dim datalist As List = bucket.DataSets
                    
    If datalist <> Null And datalist.Size > 0 Then
                        
    For u = 0 To datalist.Size-1
                            
    Log(datalist.Get(u))
                            
    Dim ds As DataSet = datalist.Get(u)
                            
    Dim datapoints As List = ds.DataPoints
                            
    If datapoints <> Null And datapoints.Size> 0 Then
                                
    For t=0 To datapoints.Size-1
                                    
    Dim dp As DataPoint = datapoints.Get(t)
                                    
    Log($"Value = ${dp.getValue(req.dfFIELD_STEPS)}"$' Here you get the steps for this day listed
                                Next
                            
    End If
                        
    Next
                    
    End If
                
    Next
            
    End If
        
    End If
        
    End Sub
     

    Attached Files:

  2. inakigarm

    inakigarm Well-Known Member Licensed User

  3. DonManfred

    DonManfred Expert Licensed User

    probably yes.

    Please consider this lib as being beta :)
     
    MarcoRome likes this.
  4. RWK

    RWK Member Licensed User

    Hallo Manfred,

    Code:
    B4A Version: 8.80 BETA #1
    Parse den Code.    (0.00s)
    Building folders structure.    (
    0.02s)
    Kompiliere den Code.    (
    0.03s)
    Kompiliere Layoutcode.    (
    0.00s)
    Organisiere Libraries.    (
    0.00s)
    Generiere R Datei.    Error
    ERROR: 
    In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
    ERROR: 
    In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex
    I got this compile Error, is there something i didn't install?
    I ran SDK Manager .. is up to date

    Grüße
    Rainer
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    B4A Sdk Manager?

    Make sure that android-28 is selected under Tools - Configure Paths.
     
  6. RWK

    RWK Member Licensed User

    Ah yes,

    i forgot to switch the Path to 28.

    Thank you.

    It compiles and run.... but I got an Exception after choosing my google Account.

    I will have a closer look at this in the afternoon.

    Greetings
    Rainer
     
  7. DonManfred

    DonManfred Expert Licensed User

    Please create a new thread for any question/problem you have.
     
  8. tcr49

    tcr49 Member Licensed User

    When I try this example the app is compiled ok. But the app is killed on the line
    'fc.readData(req.build)' with no error messages. Why is that, any ideas?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice