google+ api (2012)

12
Google+ API #GDG #DevFestJkt #DevFest #2012 Oon Arfiandwi <[email protected]> Manager of Google Developer Group Jakarta http://gplus.to/oonid

Upload: oon-arfiandwi

Post on 15-Jan-2015

299 views

Category:

Technology


2 download

DESCRIPTION

this is last year my presentation last year (2012). I presented on GDG DevFest Jakarta 2012. (Google Day in g|indonesia 2012). this year (2013) I will present for the same GDG DevFest event, I will bring the same topic, keep it updates with the latest version, and add some comparison with other Social Network.

TRANSCRIPT

Page 1: Google+ API (2012)

Google+ API#GDG #DevFestJkt #DevFest #2012

Oon Arfiandwi <[email protected]>Manager of Google Developer Group Jakarta

http://gplus.to/oonid

Page 2: Google+ API (2012)

so, what can be coveredin 35 mins?

Google+ API in general

OAuth2.0 + REST API

Sign in with Google+, get to know about People, Activities & Comments

Let’s code in Android + Google Play Services

Google+ History

Page 3: Google+ API (2012)

Google+ API

http://developers.google.com/+

Plugins for your website + REST API

Mobile Platform (Android, iOS, mobile web)

Hangout API

History API (developer preview)

Page 4: Google+ API (2012)

OAuth 2.0

Generate OAuth 2.0 Token

via Google Play ServicesGoogleAuthUtil.getToken()

via Google APIs Client Library for Javacreate API Project with Google APIs Consoleopen browser to URL from GoogleAuthorizationCodeRequestURL

get Token via execute GoogleAuthorizationCodeTokenRequest

Page 5: Google+ API (2012)

Activate Service:Google+ APIGoogle+ History API

Create:OAuth 2.0 client ID

Google APIs Console

Page 6: Google+ API (2012)

String googleAuthorizationCodeRequestUrl = new GoogleAuthorizationCodeRequestUrl( ShrdPrfsStore.CLIENT_ID,ShrdPrfsStore.REDIRECT_URI,ShrdPrfsStore.SCOPE).build(); webview.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { if (url.startsWith(SharedPrefsStore.REDIRECT_URI)) { try { if (url.indexOf("code=") != -1) { // Url is like http://localhost/?code=4/Z5DgC1IxNL-muPsrE2Sjy9zQn2pF String code = url.substring... TokenResponse accessTokenResponse =

new GoogleAuthorizationCodeTokenRequest( new NetHttpTransport(), new JacksonFactory(), ShrdPrfsStore.CLIENT_ID, ShrdPrfsStore.CLIENT_SECRET, code, ShrdPrfsStore.REDIRECT_URI).execute();

... credentialStore.write(accessTokenResponse); ... } } catch (IOException e) {} } }; }); webview.loadUrl(googleAuthorizationCodeRequestUrl);

Page 7: Google+ API (2012)

OAuth 2.0 login with Google+ Account

Registered Product Name:DevFestJktPro

SCOPE:plus.meplus.moment.write

Page 8: Google+ API (2012)

“Public” ActivitiesAccess Google+ Activities using OAuth access token as GoogleCredential

Filter the Google+ Activities by user and collections (eg: “public”)

Create Simple ListView based on Google+ Activity Titles

Page 9: Google+ API (2012)

Google+ History API

http://developers.google.com/+/history/preview/

“Google+ history is a collection of moments that describe activities the user has engaged across the web and apps.”

Google+ history API privately save moments, users can share those moments with others.

Page 10: Google+ API (2012)

Moments in History

Types of Moments

AddActivity

BuyActivity

CheckInActivity

ListenActivity

ReviewActivity ...

Moments target URL must include attribute from schema.org markup

Request new type of Moments?

Page 11: Google+ API (2012)

Google+ History

Google+ History preview user interface, available for registered developer

History of CheckInActivity

History of AddActivity (+1)

Page 12: Google+ API (2012)

Google+ API

The endor is it the beginning?

(quote from G+ History)

Questions?