Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9601)

Issue 5167041: Add android sample for analytics v3 management api

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by srinikannan
Modified:
12 years, 6 months ago
Reviewers:
joshuavu, rmistry, jsoneja, yanivi
Visibility:
Public.

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+449 lines, -0 lines) Patch
A analytics-android-sample/.classpath View 1 chunk +17 lines, -0 lines 0 comments Download
A analytics-android-sample/.project View 1 chunk +39 lines, -0 lines 1 comment Download
A analytics-android-sample/.settings/org.eclipse.jdt.core.prefs View 1 chunk +6 lines, -0 lines 0 comments Download
A analytics-android-sample/.settings/org.maven.ide.eclipse.prefs View 1 chunk +8 lines, -0 lines 0 comments Download
A analytics-android-sample/AndroidManifest.xml View 1 chunk +19 lines, -0 lines 0 comments Download
A analytics-android-sample/default.properties View 1 chunk +12 lines, -0 lines 0 comments Download
A analytics-android-sample/pom.xml View 1 chunk +149 lines, -0 lines 0 comments Download
A analytics-android-sample/proguard.cfg View 1 chunk +48 lines, -0 lines 0 comments Download
A analytics-android-sample/res/drawable-hdpi/icon.png View Binary file 0 comments Download
A analytics-android-sample/res/drawable-ldpi/icon.png View Binary file 0 comments Download
A analytics-android-sample/res/drawable-mdpi/icon.png View Binary file 0 comments Download
A analytics-android-sample/res/layout/header.xml View 1 chunk +8 lines, -0 lines 0 comments Download
A analytics-android-sample/res/values/strings.xml View 1 chunk +4 lines, -0 lines 0 comments Download
A analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java View 1 chunk +139 lines, -0 lines 7 comments Download

Messages

Total messages: 4
srinikannan
12 years, 7 months ago (2011-09-29 22:55:30 UTC) #1
jsoneja
http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java File analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java (right): http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java#newcode51 analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java:51: * @author Srinivasan Kannan (Based on Yaniv Inbar Calendar ...
12 years, 7 months ago (2011-09-30 00:12:05 UTC) #2
yanivi
Sorry for the delay! I've got a backlog of changesets to review, and I'm just ...
12 years, 6 months ago (2011-10-17 17:08:17 UTC) #3
yanivi
12 years, 6 months ago (2011-10-17 17:09:37 UTC) #4
A few comments to start off.  Ravi might also be able to help since he is the
new owner of the Java client library.

http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/.project
File analytics-android-sample/.project (right):

http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/.projec...
analytics-android-sample/.project:1: <?xml version="1.0" encoding="UTF-8"?>
We require all of our samples to have an instructions.html file (file name MUST
be exactly that) like this one:

http://code.google.com/p/google-api-java-client/source/browse/tasks-android-s...

http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/src/mai...
File
analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java
(right):

http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/src/mai...
analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java:51:
* @author Srinivasan Kannan (Based on Yaniv Inbar Calendar Sample)
On 2011/09/30 00:12:10, jsoneja wrote:
> Since this is going to be public, I think you can delete the comment in the
> bracket.

I agree.

http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/src/mai...
analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java:53:
public class AnalyticsSample extends ListActivity {
If you haven't already, please take a look at our Buzz and Tasks Android
samples:

http://code.google.com/p/google-api-java-client/source/browse/buzz-android-sa...

http://code.google.com/p/google-api-java-client/source/browse/tasks-android-s...

One particularly useful feature for debugging is the logging.  Take a look at
the JavaDoc on those classes.

http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/src/mai...
analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java:97:
Analytics analytics = new Analytics(transport, new HttpRequestInitializer() {
On 2011/09/30 00:12:10, jsoneja wrote:
> Store the request initializer in a local variable ? Would make the code a bit
> more readable.

You should probably use ClientLogin.Response, which basically does exactly this.
 You'll need to set the "auth" field.

http://codereview.appspot.com/5167041/diff/1/analytics-android-sample/src/mai...
analytics-android-sample/src/main/java/com/google/api/client/sample/analytics/android/AnalyticsSample.java:129:
if (statusCode == 401) {
On 2011/09/30 00:12:10, jsoneja wrote:
> could this coupled with repeated auth failures lead to a infinite loop ?

Yes.  The Calendar sample has this TODO:

      // TODO(yanivi): should only try this once to avoid infinite loop

Really we should only retry on a 401 once, and fail the second time.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b