google-fit-sdk

Android: How to get Google Fit data from Wearable device?

无人久伴 提交于 2019-12-29 05:51:45
问题 I'm following the same steps described here (the Google Fit client connection part is working fine). final DataType dataType=TYPE_STEP_COUNT_DELTA; DataSourcesRequest requestData = new DataSourcesRequest.Builder() .setDataTypes(dataType) // At least one datatype must be specified. .build(); Fitness.SensorsApi.findDataSources(mClient, requestData) .setResultCallback(new ResultCallback<DataSourcesResult>() { @Override public void onResult(DataSourcesResult dataSourcesResult) { Log.i(TAG,

Google fit API OAUTH Issue

不问归期 提交于 2019-12-25 01:39:59
问题 I'm trying to build a step counter application, as a test i downloaded the android fit code from github and ran the basicsensorsAPI: googlesamples/android-fit In order to get stepcount instead of location I changed the data type to TYPE_STEP_COUNT_CUMULATIVE and TYPE_DERIVED , (the orignials are TYPE_LOCATION_SAMPLE and TYPE_RAW ). But as soon as I do this the OAUTH stops working, and i'm not sure why this is creating an issue. Here is the changed code: private void findFitnessDataSources() {

Custom DataTypes not synching between devices

孤者浪人 提交于 2019-12-24 02:43:35
问题 I am trying to use the Google Fit API to store custom dataTypes . I am able insert, and retrieve them fine on a single device, but when I log into the same Google account on a different device the data is not there. I can create and retrieve data from each device but they both keep their own data, and do not sync up thru the cloud. I have tried using .enableServerQueries() in my DataReadRequest builder and still nothing. 来源: https://stackoverflow.com/questions/28059665/custom-datatypes-not

Google Fit API : Get distance/calories/speed when tracking running/biking?

自作多情 提交于 2019-12-24 00:09:42
问题 I'm developing a fitness app for Android devices to track activities like running or bikings and discovered that Google Fit API can help me a lot doing it. But when I started playing with the Google samples from GitHub, I found a few problems in my way. Firstly, it doesn't seem to work well with the Android Emulator. I activate the SensorsAPI to get GPS updates with a listener but it doesn't return any DataPoints. When running on a real device it seems to work a little bit better, though. My

google fit sdk running distance

天涯浪子 提交于 2019-12-23 21:50:28
问题 I am trying to find the distance the user has runned using the Google Fit SDK. Currently i am using this piece of code DataReadRequest readRequest = new DataReadRequest.Builder().aggregate(DataType.TYPE_DISTANCE_DELTA, DataType.AGGREGATE_DISTANCE_DELTA) .bucketByTime(1, TimeUnit.DAYS) .setTimeRange(mStartTime, mEndTime, TimeUnit.MILLISECONDS) .build(); It's working fine except that it returns the distance travelled by the user no matter what way ( by car, airplane, etc...) How do i filter it

Reading other user's Google Fit data via REST API

邮差的信 提交于 2019-12-23 04:56:44
问题 We have a user who gave consent for our Cloud Project to read their Fit data through the Android app. We now want user's coach to access their Fit data through a web UI associated with our Cloud Project. Is this possible, and if so, what is the right way to do it? Can cross-client identity be used? https://developers.google.com/identity/protocols/CrossClientAuth I was trying to replace "me" with "user@gmail.com" in the REST endpoint but it doesn't work: https://www.googleapis.com/fitness/v1

Android Google Fit example is not working

╄→尐↘猪︶ㄣ 提交于 2019-12-23 03:41:13
问题 I have problems to get the example apps for Google Fit running provided by Google. I figured out so far, that the resultCode I get in onActivityResult is 0 after I selected an Account . The example app I use at the moment is BasicRecordingApi , which can be found here. But I've tried the others too. I created an API key for the app and I enabled Google Fit API already. Nothing helps. Any ideas? 回答1: Getting Started on Android This explains how to start developing with Google Fit on Android.

Google Fit API Activity History

家住魔仙堡 提交于 2019-12-20 04:18:04
问题 I have an app that integrates with Google Fit. One of the requirements is display a users favorite activity (most frequent) i.e.: bicycling. I assume it would be done through the History API, but I'm not sure how to gather all activities so I can calculate the most common one. Anybody have any idea how to go about doing that? 回答1: You can check this documentation: Work with the Fitness History to get most frequent activity of the user. First, you need to read data from the fitness history by

Android Google Fit onConnectionFailed() SIGN_IN_REQUIRED

*爱你&永不变心* 提交于 2019-12-19 07:43:47
问题 I can't seem to get round this issue. I just cannot sign in. I'm running the BasicSensorApi sample file and it just will not connect. It seems i'm getting RESULT_CANCELED even though i select an account on the dialog? Here is the end of my logcat running on a OnePlus One 4.4. Any ideas on what i need to do? (The Google console is set up with 'net.xx', correct SHA1, Fitness APi enabled. 01-26 15:54:06.838 15678-15678/net.xx D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002 01-26 15:54:06.888

Getting list of activities(Movements) from google fit api

女生的网名这么多〃 提交于 2019-12-19 03:37:23
问题 I am creating application which can use google fit api. I want to get all the activities(Movements) available in the google fit. Here the list of activities in google fit Reference. Edited I know the way how to get the activities which performed by user, But i want complete list of activities which available in the google fit API (Not only the activity which performed by user, need whole list of activities) like the list available in the above link. 回答1: The Google Fit activities are listed