Surendra Naidu Karna
Surendra Naidu Karna

Reputation: 49

Fit API issue with Reading Calories and Distance

I am trying to read Steps, Distance and Calories from Google Fit API,

Used below data request for steps

 val dataSource = DataSource.Builder()
            .setAppPackageName("com.google.android.gms")
            .setDataType(DataType.TYPE_STEP_COUNT_DELTA)
            .setType(DataSource.TYPE_DERIVED)
            .setStreamName("estimated_steps")
            .build(). 

The above request working successfully for Steps i modified data type and stream for Calories and distance but i am getting 0 .

val dataSource = DataSource.Builder()
            .setAppPackageName("com.google.android.gms")
            .setDataType(DataType.TYPE_CALORIES_EXPENDED)
            .setType(DataSource.TYPE_DERIVED)
            .setStreamName("estimated_calories")
            .build().  

What is wrong here? Any one have a solution??

Thank you!

Upvotes: 0

Views: 27

Answers (0)

Related Questions