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
520
物資管理系統與災民證
yurenju
0
1.1k
JavaScript 開發流程自動化懶人包
yurenju
38
6.1k
Code Coverage -- Javascript Frontend + Backend
yurenju
14
8.1k
Loopback + Angular.js
yurenju
3
610
bifrost 物資管理系統
yurenju
4
330
Gaia Build System introduction
yurenju
2
220
Other Decks in Programming
See All in Programming
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
780
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
140
Contextとはなにか
chiroruxx
1
390
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.6k
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
140
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
250
Vite+ Unified Toolchain for the Web
naokihaba
0
410
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7.2k
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.6k
Oxcを導入して開発体験が向上した話
yug1224
4
370
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
7.2k
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
190
Featured
See All Featured
Mind Mapping
helmedeiros
PRO
1
270
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Navigating Team Friction
lara
192
16k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
450
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
340
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
490
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
The agentic SEO stack - context over prompts
schlessera
0
840
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