25

Use Web APIs Building Android Applications that

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Use Web APIs Building Android Applications that
Page 2: Use Web APIs Building Android Applications that

Building Android Applications that Use Web APIsYaniv Inbar, Senior Software Engineer, GoogleSriram Saroop, Product Manager, Google

#io12 #AndroidWebAPIs

Page 3: Use Web APIs Building Android Applications that

Android and Web APIs

Web

AP

IsE

ndpo

ints

#io12 #AndroidWebAPIs

Page 4: Use Web APIs Building Android Applications that

Blogger APIBooks APICalendar APIDrive APIGoogle+ APIPrediction APITasks APITranslate APIYouTube API

Google's Web APIs

Web

AP

Is#io12 #AndroidWebAPIs

Page 5: Use Web APIs Building Android Applications that

Google Client Libraries for Java

HTTP (goo.gl/onpMx)

OAuth (goo.gl/dXFtZ)

Google API Libraries & Base Library(goo.gl/yV6R6)

#io12 #AndroidWebAPIs

Open Source (Apache License 2.0)

Page 6: Use Web APIs Building Android Applications that

Client Library Architecture

HTTP Android App Engine JSON XML

OAuth 2.0

OAuth 1.0a

Partial JSON Batch Media JSON

Errors

Blogger Calendar Google+ Tasks Translate

HTTP

OAuth

Google Base Lib

API Libraries

#io12 #AndroidWebAPIs

Page 7: Use Web APIs Building Android Applications that

Google's Web APIs References

#io12 #AndroidWebAPIs

Google APIs: Getting Startedyoutu.be/SZj6rAYkYOg

Optimizing Your Code Using Features of Google APIsgoo.gl/dNwik

Page 8: Use Web APIs Building Android Applications that

OAuth 2.0

#io12 #AndroidWebAPIs

requests with access tokenstart app

Google Auth Server

allow app?access token

valid access token?

Page 9: Use Web APIs Building Android Applications that

OAuth 2.0 Scopes

#io12 #AndroidWebAPIs

Calendar API

Scope Permissioncalendar Manage your calendarscalendar.readonly View your calendars

e.g. https://www.googleapis.com/auth/calendar.readonly

Page 10: Use Web APIs Building Android Applications that

OAuth 2.0 Reference

#io12 #AndroidWebAPIs

OAuth 2.0 for Identity and Data Accessgoo.gl/d7jFg

Using OAuth 2.0 to Access Google APIsgoo.gl/W1hUc

Page 11: Use Web APIs Building Android Applications that

“OAuth on Android is complicated”

Page 12: Use Web APIs Building Android Applications that

AccountManager Woes (Froyo)

#io12 #AndroidWebAPIs

Old Way

Page 13: Use Web APIs Building Android Applications that

Google Play services (Froyo)

#io12 #AndroidWebAPIs

Coming

Soon

Page 14: Use Web APIs Building Android Applications that

AccountPicker in Google Play services (Froyo)

#io12 #AndroidWebAPIs

Coming

Soon

Page 15: Use Web APIs Building Android Applications that

Google Play services

#io12 #AndroidWebAPIs

Coming Soon

● Froyo or later● Readable permissions● AccountPicker● Secure: application signature

○ No API key● Token Caching

○ No expired tokens

https://developers.google.com/android/google-play-services

Page 16: Use Web APIs Building Android Applications that

Demo: Calendar API Sampleopen source at goo.gl/1WIY4

Page 17: Use Web APIs Building Android Applications that

Google Cloud Endpoints

Page 18: Use Web APIs Building Android Applications that

Google Cloud Endpoints:Backend for Mobile and Web Apps

Storage

Web APIs

End

poin

ts

Trusted Tester

#io12 #AndroidWebAPIs

ApplicationBackend

Page 19: Use Web APIs Building Android Applications that

Google Cloud Endpoints:

ApplicationBackend

Google Cloud Messaging for Android

End

poin

ts

Trusted Tester

#io12 #AndroidWebAPIs

Page 20: Use Web APIs Building Android Applications that

Endpoints Use Cases

#io12 #AndroidWebAPIs

Trusted Tester

● Centralize business logic, computation, and storage● Share application state across devices● Google Cloud Messaging to push notifications to devices

Sign Uphttp://endpoints-trusted-tester.appspot.com

Page 21: Use Web APIs Building Android Applications that

Demo: CloudNotes Endpoints Sampleopen source at goo.gl/ZlN2E

Page 22: Use Web APIs Building Android Applications that

Google Cloud Endpoints References

#io12 #AndroidWebAPIs

Building Mobile App Engine Backends for Android, iOS and the Webgoo.gl/AhPXd

HTML5 and App Engine: The Epic Tag Team Take on Modern Web Apps at Scalegoo.gl/U0zXy

Page 23: Use Web APIs Building Android Applications that

Google I/O Codelabs

Building REST APIs for Mobile with App EngineFriday, 11:00AM - 1:00PM

Building Android Applications that use Web APIsFriday, 1:15PM - 3:15PM

#io12 #AndroidWebAPIs

Page 24: Use Web APIs Building Android Applications that

Thank You!Yaniv Inbar, Senior Software Engineer, GoogleSriram Saroop, Product Manager, Google

#io12 #AndroidWebAPIs

Page 25: Use Web APIs Building Android Applications that