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
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
180
Code For America 見聞錄 - 社會安全網
yurenju
0
240
Impossible Election for recall in Taiwan
yurenju
1
510
物資管理系統與災民證
yurenju
0
1k
JavaScript 開發流程自動化懶人包
yurenju
38
6.1k
Code Coverage -- Javascript Frontend + Backend
yurenju
14
8.1k
Loopback + Angular.js
yurenju
3
590
bifrost 物資管理系統
yurenju
4
310
Gaia Build System introduction
yurenju
2
210
Other Decks in Programming
See All in Programming
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
270
20260320登壇資料
pharct
0
150
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
200
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.3k
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
330
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
310
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
750
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
460
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
AI Assistants for YourAngular Solutions @Angular Graz, March 2026
manfredsteyer
PRO
0
140
おれのAgentic Coding 2026/03
tsukasagr
1
120
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
440
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
170
Git: the NoSQL Database
bkeepers
PRO
432
67k
Balancing Empowerment & Direction
lara
5
1k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
From π to Pie charts
rasagy
0
160
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
200
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.5k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
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