You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
kestites
8 years agoExplorer | Level 4
NetworkOnMainThreadException - connecting to Dropbox account
I followed the tutorial on file uploading from the Dropbox website here: https://www.dropbox.com/developers/documentation/java#tutorial But I am having problems when running my code. Here is my e...
- 8 years ago
You're getting a NetworkOnMainThreadException, which means you're trying to make a network call on the main thread, which isn't allowed on Android. (The upload method makes a network call to the Dropbox API servers to send up the file content.) You should make this call on a background thread instead. This isn't specific to Dropbox, so there are several answers about how to do this on StackOverflow, e.g.:
https://stackoverflow.com/questions/6343166/android-os-networkonmainthreadexception
There's also an example of uploading in the background in the Android sample app included with the API v2 Java SDK:
Greg-DB
Dropbox Staff
You're getting a NetworkOnMainThreadException, which means you're trying to make a network call on the main thread, which isn't allowed on Android. (The upload method makes a network call to the Dropbox API servers to send up the file content.) You should make this call on a background thread instead. This isn't specific to Dropbox, so there are several answers about how to do this on StackOverflow, e.g.:
https://stackoverflow.com/questions/6343166/android-os-networkonmainthreadexception
There's also an example of uploading in the background in the Android sample app included with the API v2 Java SDK:
silexcorp
5 years agoExplorer | Level 4
Thank you, it really helped me a lot.
Although this is not specified in the repository: https://github.com/silexcorp/dropbox-sdk-java
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 3 years agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!