Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using Google APIs Client for Android
Search
Yuren Ju
October 28, 2012
Programming
3.3k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using Google APIs Client for Android
Yuren Ju
October 28, 2012
More Decks by Yuren Ju
See All by Yuren Ju
Taste Cucumber.js - JavaScript BDD Framework
yurenju
0
190
Code For America 見聞錄 - 社會安全網
yurenju
0
250
Impossible Election for recall in Taiwan
yurenju
1
530
物資管理系統與災民證
yurenju
0
1.1k
JavaScript 開發流程自動化懶人包
yurenju
38
6.1k
Code Coverage -- Javascript Frontend + Backend
yurenju
14
8.1k
Loopback + Angular.js
yurenju
3
620
bifrost 物資管理系統
yurenju
4
330
Gaia Build System introduction
yurenju
2
220
Other Decks in Programming
See All in Programming
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
0
1k
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
230
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.8k
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.7k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
950
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
160
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
420
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
460
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
200
Claude Team Plan導入・ガイド
tk3fftk
0
250
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
190
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
400
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
400
Are puppies a ranking factor?
jonoalderson
1
3.7k
A Tale of Four Properties
chriscoyier
163
24k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Chasing Engaging Ingredients in Design
codingconduct
0
250
Making the Leap to Tech Lead
cromwellryan
135
10k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
190
How to build a perfect <img>
jonoalderson
1
5.8k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
190
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Transcript
別再手刻 APIs Client 了 使用 Google APIs Client for Android
Yuren Ju
Yuren Ju • Open Source Community – Kalug – COSCUP
– Hacking Thursday • Open Source Developer – Lazyscripts – Ubuntu 懶人包 – Mozilla Firefox OS • Android Developer
Web service API
有很多種路可以走 ... • 手刻 – HttpGet/HttpPost • Restlet • Google
APIs Client for Java! http://www.flickr.com/photos/fractalthoughts/4903092759/in/photostream/
Implementing an API method • Build URL • Get content
(GET/POST) • Convert to object
手刻 http://www.flickr.com/photos/carnivillain/2048440745/
Building URL
Getting Content (GET)
Getting Content (POST) http://blog.csdn.net/flying_tao/article/details/6553601
Converting to object
Google APIs Client Library for Java
None
Example http://<DOMAIN-NAME>/api/emails/
[email protected]
verifyEmail(“819284”, “
[email protected]
”).execute();
Implementing an API method
Parameters Mapping http://<DOMAIN-NAME>/api/emails/
[email protected]
GET v.s. POST
POST
Preconditions
Implementing an API method
Getting started! http://code.google.com/p/google-api-java-client/wiki/Setup
Example service
.jar files
No!!!!!!!
None
Create API Client
Use Builder pattern
HttpRequestInitializer
Create Model
Implement the API
比較 • Get content (GET/POST) • Convert to object •
Preconditions • Parameter mapping/Build URL
OAuth https://github.com/yurenju/AndroidTwitterGoogleApiJavaClient
Attention! Use xAuth on mobile! OAuth experience with pin code
isn't good on mobile https://dev.twitter.com/docs/oauth/xauth
Android app Twitter OAuthGetTemporaryToken OAuthAuthorizeTemporaryTokenUrl Listen OnLoadPageFinished and parse pin
code in webpage Enter username and password Show pin code Done!
OAuthGetTemporaryToken
OAuthAuthorizeTemporaryTokenUrl
None
Parse pin code in webview Don't do it on your
production app, please use xAuth
Conclusion • Build URL • Handle POST/GET Method • Preconditions
• Android, GAE and Java SE Compatibility
FAQ