Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #16

Merged
merged 1 commit into from
Sep 9, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,36 @@ Business customers can use their [client ID and secret](https://developers.googl
### POJOs
Native objects for each of the API responses.

### Asynchronous or synchronous -- you choose

All requests support synchronous or asynchronous calling style.
```java
GeocodingApiRequest req = GeocodingApi.newRequest(context).address("Sydney");

// Synchronous
try {
req.await();
// Handle successful request.
} catch (Exception e) {
// Handle error
}

req.awaitIgnoreError(); // No checked exception.

// Async
req.setCallback(new PendingResult.Callback<GeocodingResult[]>() {
@Override
public void onResult(GeocodingResult[] result) {
// Handle successful request.
}

@Override
public void onFailure(Throwable e) {
// Handle error.
}
});
```

API Coverage
------------

Expand All @@ -74,3 +104,20 @@ The following APIs are supported:
* [Elevation API](https://developers.google.com/maps/documentation/elevation)
* [Geocoding API](https://developers.google.com/maps/documentation/geocoding)
* [Time Zone API](https://developers.google.com/maps/documentation/timezone)

Building the project
--------------------

```
# Compile and package the project
./gradlew jar
# Run the tests. Note: you will need an API key to run the tests.
API_KEY=AIza.... ./gradlew test
# Run the tests with enterprise credentials.
API_KEY=... CLIENT_ID=... CLIENT_SECRET=... ./gradlew test
# Generate documentation
./gradlew javadoc
```