How to make Twitter app with PhoneGap/Cordova

18
Get Help Building Your PhoneGap Hybrid App Overview and Workshop May 22, 2014 MASAHIRO TANAKA FOUNDER & CEO, MONACA The Official PhoneGap Meetup :: SF Bay Area

description

This presentation is created for PhoneGap Meetup San Francisco, held on May 22, 2014. It describes how you can develop a Twitter client using PhoneGap/Cordova framework, and using Monaca as a development platform. Includes source code with description. Uses Onsen UI CSS Components, jsOAuth, underscore, micro templating, and other techniques to develop a nice & beautiful UI. For more details about Monaca, please come to the Website: http://monaca.mobi/

Transcript of How to make Twitter app with PhoneGap/Cordova

Page 1: How to make Twitter app with PhoneGap/Cordova

Get Help Building Your

PhoneGap Hybrid App

Overview and WorkshopMay 22, 2014

MASAHIRO TANAKA

FOUNDER & CEO, MONACA

The Official PhoneGap Meetup :: SF Bay Area

Page 2: How to make Twitter app with PhoneGap/Cordova

Venue provided by Adobe.

Page 3: How to make Twitter app with PhoneGap/Cordova

Who am I?

Masahiro TanakaFounder & CEO, Monaca

Twitter: @massie

E-mail: [email protected]

Recent books and magazines:

Page 4: How to make Twitter app with PhoneGap/Cordova

PhoneGap company.Official docs

translations.

#1 PG community

In Japan.

Cloud IDE

Page 5: How to make Twitter app with PhoneGap/Cordova

What’s HOT in PhoneGap?

Page 6: How to make Twitter app with PhoneGap/Cordova

No.1Platform: PhoneGap

Page 7: How to make Twitter app with PhoneGap/Cordova

Why PhoneGap?

Open & standard technology.

Allows greater access to mobile

development.

Page 8: How to make Twitter app with PhoneGap/Cordova

Today’s Workshop

Twitter Client from Onsen CSS Components:

http://components.onsenui.io/

Page 9: How to make Twitter app with PhoneGap/Cordova

Using Twitter API

Useful resource: https://dev.twitter.com/docs/api/1.1

Twitter opens all features.

All APIs are RESTful (Ajax), but requires auth.

Be careful about # of request has limitation.

Example: Timeline

https://dev.twitter.com/docs/api/1.1/get/statuses/mentions_timeline

Example: Specific user

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=monaca_io&count=20

Page 10: How to make Twitter app with PhoneGap/Cordova

Run on your device now!

Here, I will use Monaca for quicker start.

http://monaca.mobi/

Please access and signup (forever free):

You can also use your Cordova environment.

Page 11: How to make Twitter app with PhoneGap/Cordova

Install debugger app

Find and install

“Monaca”

Page 12: How to make Twitter app with PhoneGap/Cordova

Import the project

Open dashboard, and click New Project.

Then, import from the following URL:

https://github.com/monaca/sample-twitter-client

Page 13: How to make Twitter app with PhoneGap/Cordova

Edit index.html

Open index.html and replace consumer key and

secret to your Twitter API key and secret.

Page 14: How to make Twitter app with PhoneGap/Cordova

Run It!

Page 15: How to make Twitter app with PhoneGap/Cordova

Code Reading

oAuth handling

jsOAuth (http://bytespider.github.io/jsOAuth/)

Micro templating

Underscore.js (http://underscorejs.org/)

Important keywords for code reading:

Page 16: How to make Twitter app with PhoneGap/Cordova

Want a native-like UI for

your PhoneGap app?

1. Performance oriented.

2. Web-component based.

3. Fully customizable.

4. Android 2.3, multi-screen.

http://onsenui.io/

Page 17: How to make Twitter app with PhoneGap/Cordova

Thank you.

Check @monaca_io to download this slide

and the source code.

Page 18: How to make Twitter app with PhoneGap/Cordova

Contest runs until June 30, 2014