

In LoginActivity replace all the auto-generated code, except the project package name, with the following: public class LoginActivity extends AppCompatActivity Now the user is authenticated, they need an access token. The startOAuth2Authentication() method doesn’t return any access Token, it only opens AuthActivity which is internally used for authentication. After the user has confirmed their Dropbox account, redirect them to the LoginActivity. In the AuthActivity the user must confirm their Dropbox account. The startOAuth2Authentication() method will open the Dropbox AuthActivity, this is the activity added to the Manifest file. On a button click it performs a login task to generate an access token for the Dropbox app identified by the APP_KEY in the string resources. The LoginActivity‘s task is straightforward. The app console contains app info and you will need the App Key for the Android project. When the app is ready you have to apply for production status. With this status the app can only be used by test users and if you Enable Additional Users these can be up to 100. Create a new app in the App Console.Īfter the new app is created it will be set to development status. To connect with Dropbox, you need to have a dropbox account and use the Dropbox API. You can find the final code for this project on GitHub. This SDK also supports the older Core API v1, but that support will be removed at some point. According to the SDK description this Core SDK is a Java library to access Dropbox’s HTTP-based Core API v2. In this tutorial I will explain how to store files from an Android app in Dropbox by using the Dropbox Core SDK for Java 6+ in Android. Cloud storage has it’s problems, but offers near infinite capacity and low cost. Traditionally storage was local, but the past years have seen an increasing move to storing in the cloud. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!ĭocument and file storage has been essential to computing devices since their inception. This article was peer reviewed by Wern Ancheta.
