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: CHANGELOG.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,36 @@
1
+
v0.5.0 - 6/2/2016
2
+
------------------
3
+
This release sets up the Java SDK for the Uber Android SDK to utilize it as a third party dependency by adding common interfaces and removing heavier weight components.
4
+
5
+
### Added
6
+
7
+
#### SessionConfiguration
8
+
SessionConfiguration is a new class to hold on to client information for authentication. This is used by underlying components.
9
+
10
+
#### UberRidesApi
11
+
12
+
`UberServices` has been replaced with `UberRidesApi`, which uses a `Session` to construct Api Services
13
+
14
+
#### Sessions
15
+
`AccessTokenSession`, `ServerTokenSession`, and `CredentialSession` have been added for the three types of authentication.
16
+
17
+
#### AccessTokenStorage
18
+
A common interface to store access tokens
19
+
20
+
#### RidesService
21
+
Replaces `UberRidesSyncService` and `UberRidesAsyncService` with a Retrofit 2 based API Service. Both sync and async can be utilized directly on the resulting `Call<T>`
22
+
23
+
### Changed
24
+
- Split packaging into core and rides
25
+
- `Oauth2Credentials` now accepts a `SessionConfiguration`
26
+
- Updated from Retrofit 1 to Retrofit 2
27
+
- Updated from OkHttp2 to OkHttp3
28
+
- Removed Gauva dependency
29
+
30
+
### Breaking
31
+
- Removed `UberServices` in favor of `UberRidesApi`
32
+
- Removed `UberRidesSyncService` and `UberRidesAsyncService` in favor of `RidesService`
Copy file name to clipboardExpand all lines: README.md
+70-22Lines changed: 70 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,13 @@ This SDK helps your Java App make HTTP requests to the Uber Rides API.
8
8
#### Before you begin
9
9
Register your app in the [Uber developer dashboard](https://developer.uber.com/dashboard). Notice that the app gets a client ID, secret, and server token required for authenticating with the API.
10
10
11
-
Note: This Java SDK is not suitable for Android development. We will release an official Android SDK soon.
11
+
Note: Using Android? Be sure to checkout the [Uber Android SDK](github.com/uber/rides-android-sdk) in addition, which has native authentication mechanisms.
12
12
13
13
#### Gradle
14
14
If using Gradle, add this to your project’s `build.gradle` file:
15
15
```gradle
16
16
dependencies {
17
-
compile 'com.uber.sdk:rides:0.3.0'
17
+
compile 'com.uber.sdk:rides:0.5.0'
18
18
}
19
19
```
20
20
@@ -24,32 +24,41 @@ If using Maven, add this to your project's `pom.xml` file:
24
24
<dependency>
25
25
<groupId>com.uber.sdk</groupId>
26
26
<artifactId>rides</artifactId>
27
-
<version>0.3.0</version>
27
+
<version>0.5.0</version>
28
28
</dependency>
29
29
```
30
30
31
31
### Authenticating and creating a session
32
-
To make calls, you need to create an authenticated session with the API. While operations on behalf of users require a user-authorized token using OAuth 2, general requests can use server-token authentication.
32
+
To make calls, you need to create an authenticated session with the API. While operations on behalf of users require a user-authorized token using OAuth 2, general requests can use server-token authentication.
33
+
33
34
34
35
#### Create a session using a server token
35
36
```java
36
37
// Get the server token for your app from the developer dashboard.
In an OAuth session, the app first asks the user to authorize and then exchanges the authorization code for an access token from Uber.
44
47
Note: Make sure the redirect URI matches the callback URI in the developer dashboard for the app.
45
48
46
49
**Step 1**. Create an OAuth2Credentials object with your client ID, client secret, scopes, and a redirect callback URI to capture the user’s authorization code.
**Step 5**. Instantiate a service using a session to start making calls.
70
76
```java
71
-
UberRidesSyncService service =UberRidesServices.createSync(session);
77
+
RidesService service =UberRidesApi.with(session).createService();
72
78
```
73
79
Note: Keep each user's access token in a secure data store. Reuse the same token to make API calls on behalf of your user without repeating the authorization flow each time they visit your app. The SDK handles the token refresh automatically when it makes API requests with an `UberRidesService`.
74
80
75
81
## Sync vs. Async Calls
76
-
Both synchronous and asynchronous calls work with the Uber rides Java SDK. Instantiate your service appropriately with `UberRidesServices.createSync(session)` or `UberRidesServices.createAsync(session)`. Asynchronous calls are returned on a platform appropriate thread accessible through callbacks.
82
+
Both synchronous and asynchronous calls work with the Uber rides Java SDK. The networking stack for the Uber SDK is powered by [Retrofit 2](https://github.com/square/retrofit) and the same model of threading is available.
Use the Java classes in the [samples](https://github.com/uber/rides-java-sdk/tree/master/samples/cmdline-sample) folder to test standard requests. Alternatively, you can download a sample from the [releases page](https://github.com/uber/rides-java-sdk/releases/tag/v0.1.0) to try them out.
@@ -83,8 +124,8 @@ For full documentation, visit our [Developer Site](https://developer.uber.com/v1
83
124
### Get available products
84
125
```java
85
126
// Get a list of products for a specific location in GPS coordinates, example: 37.79f, -122.39f.
A successful update returns a 204 for `response.getStatus()`.
160
+
A successful update returns a 204 for `response.code()`.
116
161
117
-
Note: The `updateSandboxRide` method is not valid in the `PRODUCTION``Environment`, where the ride status changes automatically. In a `PRODUCTION``Environment`, the call throws an `IllegalStateException`.
162
+
Note: The `updateSandboxRide` method is not valid in the `PRODUCTION``Environment`, where the ride status changes automatically. In a `PRODUCTION``Environment`, the call will fail.
118
163
119
164
## Getting Help
120
165
Uber developers actively monitor the [uber-api tag](http://stackoverflow.com/questions/tagged/uber-api) on StackOverflow. If you need help installing or using the library, ask a question there. Make sure to tag your question with `uber-api` and `java`!
121
166
167
+
## Migrating from a previous version
168
+
As the Uber SDK get closer to a 1.0 release, the API's will become more stable. In the meantime, be sure to check out the changelog to know what differs!
169
+
122
170
## Contributing
123
171
We :heart: contributions. If you find a bug in the library or would like to add new features, go ahead and open
124
172
issues or pull requests against this repo. Before you do so, please sign the
0 commit comments