Skip to content

Commit b257207

Browse files
authored
docs: removes reference to deprecated service (Google+) (#1530)
1 parent 9d11712 commit b257207

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

docs/android.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you are developing for Android and the Google API you want to use is included
88
in the [Google Play Services library][play-services], use that library for the
99
best performance and experience.
1010

11-
To access other Google APIs, use the Google Client Library for Java's
11+
To access other Google APIs, use the Google APIs Client Library for Java's
1212
Android-specific helper classes, which are well-integrated with
1313
[Android AccountManager][account-manager].
1414

@@ -51,19 +51,29 @@ fields are returned to you in the HTTP response. This can significantly reduce
5151
the size of the response, thereby reducing network usage, parsing response time,
5252
and memory usage. It works with both JSON and XML.
5353

54-
The following snippet of code drawn from the Google+ Sample demonstrates how to
55-
use the partial-response protocol:
56-
54+
The following snippet of code drawn from the [Google Drive API Quickstart][quickstart]
55+
demonstrates how to use the partial-response protocol. The `setFields` method
56+
identifies the fields you want returned:
5757

5858
```java
59-
Plus.Activities.List listActivities = plus.activities().list("me", "public");
60-
listActivities.setMaxResults(5L);
61-
// Pro tip: Use partial responses to improve response time considerably
62-
listActivities.setFields("nextPageToken,items(id,URL,object/content)");
63-
ActivityFeed feed = listActivities.execute();
59+
// Print the names and IDs for up to 10 files.
60+
FileList result = service.files().list()
61+
.setPageSize(10)
62+
.setFields("nextPageToken, files(id, name)")
63+
.execute();
64+
List<File> files = result.getFiles();
65+
if (files == null || files.isEmpty()) {
66+
System.out.println("No files found.");
67+
} else {
68+
System.out.println("Files:");
69+
for (File file : files) {
70+
System.out.printf("%s (%s)\n", file.getName(), file.getId());
71+
}
72+
}
6473
```
6574

6675
[play-services]: https://developer.android.com/google/play-services/index.html
6776
[account-manager]: http://developer.android.com/reference/android/accounts/AccountManager.html
6877
[http-client-android]: https://github.com/googleapis/google-http-java-client/wiki/Android
6978
[oauth2-android]: https://github.com/googleapis/google-api-java-client#oauth2-android
79+
[quickstart]: https://developers.google.com/drive/api/v3/quickstart/java

docs/errors.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ When an error status code is detected in an HTTP response to a Google API that
3333
uses the JSON format, the generated libraries throw a
3434
[`GoogleJsonResponseException`][google-json-response-exception].
3535

36-
The errors use the format specified in [Error responses][error-responses].
37-
3836
The following example shows one way that you can handle these exceptions:
3937

4038
```java
41-
Plus.Activities.List listActivities = plus.activities().list("me", "public");
39+
Drive.Files.List listFiles = drive.files.list();
4240
try {
43-
ActivityFeed feed = listActivities.execute();
41+
FileList response = listFiles.execute();
4442
...
4543
} catch (GoogleJsonResponseException e) {
4644
System.err.println(e.getDetails());
@@ -49,4 +47,3 @@ try {
4947

5048
[google-analytics-api]: https://developers.google.com/analytics/
5149
[google-json-response-exception]: https://googleapis.dev/java/google-api-client/latest/com/google/api/client/googleapis/json/GoogleJsonResponseException.html
52-
[error-responses]: https://developers.google.com/url-shortener/v1/getting_started?csw=1#errors

0 commit comments

Comments
 (0)