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

Android Studio OAuth Help

ANSWERED

I am a college student and I am trying to create a mobile app on Android Studio that can access a user's Fitbit data. Using the API, do I have to use a Web Server to act as a middle man to grab the data or is there some way that I can go from mobile app directly to fitbit data? Also when registering for an API, what options do I select? Browser or Desktop? Personal or client? Like I said, I am using Android Studio to create this app for only mobile if I can. Thanks.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@SunsetRunner wrote:

I am a college student and I am trying to create a mobile app on Android Studio that can access a user's Fitbit data. Using the API, do I have to use a Web Server to act as a middle man to grab the data or is there some way that I can go from mobile app directly to fitbit data?


With OAuth 2.0, you do not need a web server application. You can use the Fitbit Web API directly. Use the Implicit Grant flow to obtain user consent.

 


@SunsetRunner wrote:

Also when registering for an API, what options do I select? Browser or Desktop? Personal or client?


For OAuth 1.0a type, you can choose 'Browser'. OAuth 1.0a is going away in April, so it doesn't really matter.

 

For OAuth 2.0 type, you'd choose 'client' because you are developing an app that runs clientside (i.e. on a device you don't control).

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

@SunsetRunner wrote:

I am a college student and I am trying to create a mobile app on Android Studio that can access a user's Fitbit data. Using the API, do I have to use a Web Server to act as a middle man to grab the data or is there some way that I can go from mobile app directly to fitbit data?


With OAuth 2.0, you do not need a web server application. You can use the Fitbit Web API directly. Use the Implicit Grant flow to obtain user consent.

 


@SunsetRunner wrote:

Also when registering for an API, what options do I select? Browser or Desktop? Personal or client?


For OAuth 1.0a type, you can choose 'Browser'. OAuth 1.0a is going away in April, so it doesn't really matter.

 

For OAuth 2.0 type, you'd choose 'client' because you are developing an app that runs clientside (i.e. on a device you don't control).

Best Answer
0 Votes

Is there an example that I can follow that goes from an Android Studio app to Fitbit.com and back returning the tokens as necessary for OAuth2.0. I am unsure how to start the process of OAuth2.0. I have read the OAuth2.0 document, but a working example would be a lot easier to learn from and implement. 

Best Answer
0 Votes

@SunsetRunner You would need to create the code yourself, we don't have example code. My only suggestion would be to review the documentation again and maybe google Android Studio OAuth 2.0 (perhaps this link will help?). 

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes