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
5
3.3k
Using Google APIs Client for Android
Yuren Ju
October 28, 2012
Tweet
Share
More Decks by Yuren Ju
See All by Yuren Ju
Taste Cucumber.js - JavaScript BDD Framework
yurenju
0
170
Code For America 見聞錄 - 社會安全網
yurenju
0
230
Impossible Election for recall in Taiwan
yurenju
1
490
物資管理系統與災民證
yurenju
0
1k
JavaScript 開發流程自動化懶人包
yurenju
38
6.1k
Code Coverage -- Javascript Frontend + Backend
yurenju
14
8k
Loopback + Angular.js
yurenju
3
580
bifrost 物資管理系統
yurenju
4
300
Gaia Build System introduction
yurenju
2
210
Other Decks in Programming
See All in Programming
Fluid Templating in TYPO3 14
s2b
0
120
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.4k
AtCoder Conference 2025
shindannin
0
1k
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
今から始めるClaude Code超入門
448jp
5
6.6k
Apache Iceberg V3 and migration to V3
tomtanaka
0
120
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
270
AgentCoreとHuman in the Loop
har1101
5
200
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
150
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
190
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
150
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
130
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Testing 201, or: Great Expectations
jmmastey
46
8k
Become a Pro
speakerdeck
PRO
31
5.8k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
36k
Exploring anti-patterns in Rails
aemeredith
2
230
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
440
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
160
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
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