Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
kestites
10 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...
- 10 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 Community Moderator
10 years agoYou'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:
- silexcorp6 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.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!