Comments (7)
Are you enabling debug on the StravaConfig
?
StravaConfig config = StravaConfig.withToken(TOKEN)
.debug()
.build();
That may help to visualize what is being serialized incorrectly to JSON. Also, make sure the path to the GPX file is correct.
from stravazpot-android.
Thanks for the quick answer. I found out that I am using the wrong StravaConfig instance to call the API. Now it is working perfectly fine! I'll close this issue soon but one more question about the UploadAPI.
According to Strava document, only "data_type"
and "file"
is required when uploading. Is there any design reason why we should fill in all fields (such as name, description, etc) before we can execute() it?
Thanks again for the support.
from stravazpot-android.
No, the Upload API lets you omit those parameters which are not required by Strava. You simply omit the call to the method and it will check internally:
UploadStatus uploadStatus = uploadAPI.uploadFile(new File(gpxDir, filename))
.withDataType(DataType.GPX)
.execute();
from stravazpot-android.
I might have missed something but I got this exception if I only call withDataType():
upload failed with exception:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.sweetzpot.stravazpot.upload.model.UploadActivityType.toString()' on a null object reference
from stravazpot-android.
I'm sorry, you are right. All parameters are required at this point. According to Strava docs, it does not state that they are optional though, so you will need to set appropriate values to all the parameters.
from stravazpot-android.
Thanks for confirmation. I did read the code and found out so. Didn't know if it's design choice or not since I am only using the upload API part. Thanks again for this awesome library!
from stravazpot-android.
Thank you for using it!
from stravazpot-android.
Related Issues (20)
- Logout?
- Question abut token HOT 1
- State field missing
- Is there any function that can deauthorize? , seems like there is no deauthorize function on new released version HOT 13
- Support for virtual runs HOT 20
- Error with OAuth HOT 1
- Retrofit response caching HOT 1
- dependencies aren't downloading in version 1.3.1 HOT 2
- What to put in redirect uri and CODE HOT 5
- Refresh Token Update HOT 1
- ERR_TOO_MANY_REDIRECTS
- java.lang.NumberFormatException: Expected an int but was 2158942700 at line 1 column 302 path $[0].upload_id HOT 7
- Issue sending TXC file
- Support new Oauth authentication
- Number of activities in Strava exceed Integer MAX_VALUE
- Facebook login page layout
- Issues with Getting Segments HOT 4
- Error at Sign in with Google HOT 5
- Segment.getMap does not have polyline field. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stravazpot-android.