You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ReadMe.md
+17-41Lines changed: 17 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ If you're using Maven, then edit your project's "pom.xml" and add this to the `<
14
14
<dependency>
15
15
<groupId>com.dropbox.core</groupId>
16
16
<artifactId>dropbox-core-sdk</artifactId>
17
-
<version>2.0.3</version>
17
+
<version>2.0.4</version>
18
18
</dependency>
19
19
```
20
20
@@ -23,10 +23,12 @@ If you are using Gradle, then edit your project's "build.gradle" and add this to
23
23
```groovy
24
24
dependencies {
25
25
// ...
26
-
compile 'com.dropbox.core:dropbox-core-sdk:2.0.3'
26
+
compile 'com.dropbox.core:dropbox-core-sdk:2.0.4'
27
27
}
28
28
```
29
29
30
+
You can also download the Java SDK JAR and and its dependencies directly from the [latest release page](https://github.com/dropbox/dropbox-sdk-java/releases/latest).
31
+
30
32
## Get a Dropbox API key
31
33
32
34
You need a Dropbox API key to make API requests.
@@ -46,23 +48,21 @@ Save the API key to a JSON file called, say, "test.app":
46
48
## Using the Dropbox API
47
49
48
50
Before your app can access a Dropbox user's files, the user must authorize your application using OAuth 2. Successfully completing this authorization flow gives you an _access token_ for the user's Dropbox account, which grants you the ability to make Dropbox API calls to access their files.
49
-
* Example for a simple web app: [Web File Browser example](examples/web-file-browser/src/com/dropbox/core/examples/web_file_browser/DropboxAuth.java)
51
+
* Example for a simple web app: [Web File Browser example](examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java)
50
52
* Example for an Android app: [Android example](examples/android/src/main/java/com/dropbox/core/examples/android/UserActivity.java)
51
-
* Example for a command-line tool: [Command-Line Authorization example](examples/authorize/src/com/dropbox/core/examples/authorize/Main.java)
53
+
* Example for a command-line tool: [Command-Line Authorization example](examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java)
52
54
53
55
Once you have an access token, create a [`DbxClientV2`](https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.0.x/com/dropbox/core/v2/DbxClientV2.html) and start making API calls.
54
56
55
57
You only need to perform the authorization process once per user. Once you have an access token for a user, save it somewhere persistent, like in a database. The next time that user visits your app's, you can skip the authorization process and go straight to creating a `DbxClientV2` and making API calls.
56
58
57
59
## Running the examples
58
60
59
-
Prerequisites: Apache Maven
60
-
61
61
1. Download this repository.
62
62
2. Save your Dropbox API key in a file called "test.app". See: [Get a Dropbox API key](#get-a-dropbox-api-key), above.
63
-
3.`mvn install`
64
-
4. To compile all the examples: `mvn -f examples/pom.xml compile`
65
-
5. To compile just one example: `mvn -f examples/<example-name>/pom.xml compile`.
63
+
3.Compile and install the SDK into your local maven repo: `./gradlew install`
64
+
4. To compile all the examples: `(cd examples/ && ./gradlew classes`
65
+
5. To compile just one example: `(cd examples/ && ./gradlew :<example-name>:classes`
66
66
67
67
### authorize
68
68
@@ -126,23 +126,12 @@ cd examples
126
126
## Running the integration tests
127
127
128
128
1. Run through the `authorize` example above to get a "test.auth" file.
129
-
2.`./run-integration-tests <path-to-test.auth>`
130
-
131
-
Run `./run-integration-tests` with no arguments to see how to run individual tests.
Jackson Databind makes use of reflection and annotations to map Java objects to JSON. Your ProGuard configuration should ensure Jackson annotations and Object mapping classes are kept. An example configuration is shown below:
Versions 2.0.0-2.0.3 of this SDK require specific ProGuard rules to work with shrinking enabled. However, since version **2.0.4**, the SDK no longer needs special ProGuard directives.
186
162
187
163
**IMPORTANT: If you are running version 2.0.x before 2.0.3, you should update to the latest Dropbox SDK version to avoid a deserialization bug that can cause Android apps that use ProGuard to crash.**
0 commit comments