0

My Android app is used by 1000s of customers. The app sends fitness data from external devices via BLE to a server via endpoint calls. The server runs algorithms on that data, and saves it to a database.

Now I want to send my users' data to Google Fit, but I don't want my Android app to send the data, I want my server to send the data. So the flow would be:

step counting device > BLE > android app > server > database > Fit Store

To accomplish this, I'd like to use the GoogleApiClient class to request auth for my users, and upon successful auth, send the auth "credentials" for that user to my server, so the server can upload the user's data on the app's behalf.

Where can I find the "credentials" data from the GoogleApiClient object in order to accomplish this goal?

  • I would look at using the standard web style authentication flow rather than the GoogleApiClient stuff. Then the 'credentials' are readily available. I use this in my Android app and then upload with the rest API's from Android. – Ifor May 23 '15 at 14:26
  • @lfor, I assume you're using a WebView and intercepting the HTTP response to get the token & secret from the body? Can you elaborate? – Doug996InKC May 26 '15 at 14:35
  • Yes that's the way. There are tutorials on how to do it if you look a bit. I Upload only to FIT and already have the flow all setup for 10s of other websites so adding Fit this way just fitted in far easier with my flow than having to add the dependency to Google Play services which I have avoided needing so far. – Ifor May 27 '15 at 22:11
  • I believe we'll follow this documentation: http://developer.android.com/google/auth/http-auth.html – Doug996InKC May 28 '15 at 17:03

0 Answers0