Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android app retrieve data from fitbit api

I would like to retrieve the data from fitbit api. The data used for my apps is used to build gaming function such as setting the character ability by the data from fitbit. May I know if there is any library or specific tutorial for android application to retrieve the data through oauth2 fitbit api?

Best Answer
0 Votes
12 REPLIES 12

I would like to retrieve the data from fitbit api. The data used for my apps is used to build gaming function such as setting the character ability by the data from fitbit. May I know if there is any library or specific tutorial for android application to retrieve the data through oauth2 fitbit api?

 

Best Answer
0 Votes

You should be able to use any generic OAuth 2.0 client library for Android and specify the information for Fitbit's Web API.

 

This might be useful http://technicalartistry.blogspot.ca/2016/01/fitbit-unity-oauth-2-and-native.html

Best Answer

Can only hope that it will help 😉

Best Answer
0 Votes

It is required to use unity?

Because I am using android studio only

Best Answer
0 Votes

https://developers.google.com/api-client-library/java/google-api-java-client/oauth2

I found the one from google. But it is only for google application only?

 

Best Answer
0 Votes

Also, I have try my own using chrome custom tab by a link, it can direct the user to the authentication page, and redirect back to my assigned url. But what to do next? How can I get daily activity summary?

Best Answer
0 Votes

You need to make a HTTP request for the data you want.

 

Here's how to make an OAuth 2 request (add the Authorization header): https://dev.fitbit.com/docs/oauth2/#making-requests

 

Here's information on the Get Daily Activity Summary endpoint: https://dev.fitbit.com/docs/activity/#get-daily-activity-summary

Best Answer
0 Votes

um... this is my another account.. 

anyway, May I know I would like to to build a apps that

a button for click to get the access token, after the user got authorize the app

Could it not redirect to some webpage but redirect to the app view instead?

Because this is a mobile app but not a web application

Best Answer
0 Votes

Check this out.

http://technicalartistry.blogspot.ca/2016/01/fitbit-unity-oauth-2-and-native.html

It goes a step further and goes to an app that is made in Unity but you should be able to use the same logic to go to a native android app as well (granted your app is looking for the custom scheme part.)

Best Answer
0 Votes

Did your code using custom tab for the authorization page?

What I want to do is that When I go to authoirzation page it will redirect back and giving a new url in the custom tab which contains the parameter of the access token, I would like to get it programmtically. But I don't know how to get it.

Best Answer
0 Votes

breif my case: Android using custom tab for authoirzation (implicit)

After authorized: go to the redirect back url

the custom tab can show the redirect back url and the parameter with the access_token

I would like to get it from the program, but don't know what to do

 

After getting the access token I can make request for activity data, that is what I would like to do

 

Best Answer
0 Votes

Thanks for tips about the data:scheme using in android on the reference link

 

The another issue occured is that after I go to the redirect url from the custom tab in the app.

The application seems closed and go back to the android home page. It seems close but it hide behind the background. I can press and hold the home button and turn it back, but it is not good? How can I fix this issue? 

Best Answer
0 Votes