Top Banner
AIR & API Developing Social Apps Using Adobe AIR and Social Network API’s about.me/arisetyo
52
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AIR & API

AIR & API

Developing Social Apps

Using Adobe AIR and Social Network API’s

about.me/arisetyo

Page 2: AIR & API

Arie M. PrasetyoCo-Founder, Galenic Systems

Founder, AxonDigital

Page 3: AIR & API

Presentation Outline

01 Introduction

02 Working With API & ActionScript

03 The “GroupieSize” Game App

Page 4: AIR & API

Part 01

Adobe AIR and various API’s

Introduction

Page 5: AIR & API

Adobe AIR and various API’s

Adobe Integrated Runtime

Page 6: AIR & API

Adobe AIR and various API’s

Adobe AIR FeaturesAccess File System and Local Database

Page 7: AIR & API

Adobe AIR and various API’s

Adobe AIR FeaturesAccess File System and Local Database

Runs On Various Operating Systems

Page 8: AIR & API

Adobe AIR and various API’s

Adobe AIR FeaturesAccess File System and Local Database

Runs On Various Operating Systems

Runs On Multiple Devices

Page 9: AIR & API

Adobe AIR and various API’s

Adobe AIR FeaturesAccess File System and Local Database

Runs On Various Operating Systems

Runs On Multiple Devices

Effortless Internet Connectivity

Page 10: AIR & API

Adobe AIR and various API’s

Who uses Adobe AIR?

Page 11: AIR & API

Adobe AIR and various API’s

Who uses Adobe AIR?

NASDAQNASDAQ Market Replay

A powerful desktop

application that provides

investors and brokers with

immediate access to

extremely detailed replays of

market activity at any point

in time.

Page 12: AIR & API

Adobe AIR and various API’s

Who uses Adobe AIR?

The New York TimesNew York Times Reader 2.0

With the innovative Times

Reader 2.0, readers of The

New York Times enjoy an

experience reminiscent

of reading a printed

paper, while getting the

benefits of automatic news

updates and video.

Page 13: AIR & API

Adobe AIR and various API’s

Application Programming Interface

Social networks are providing

access to third party application to

help promote their brand.

Page 14: AIR & API

Adobe AIR and various API’s

Various Social Network API’s

Facebook API & Open Graph Protocol

Page 15: AIR & API

Adobe AIR and various API’s

Various Social Network API’s

Facebook API & Open Graph Protocol

Twitter API

Page 16: AIR & API

Adobe AIR and various API’s

Various Social Network API’s

Facebook API & Open Graph Protocol

Twitter API

Google API’s

Page 17: AIR & API

Adobe AIR and various API’s

Various Social Network API’s

Facebook API & Open Graph Protocol

Twitter API

Google API’s

Amazon Web Services

Page 18: AIR & API

Adobe AIR and various API’s

Why Integrate With Social API’s?

Page 19: AIR & API

Adobe AIR and various API’s

Why Integrate With Social API’s?

Billions of Information From Millions of Users

Page 20: AIR & API

Adobe AIR and various API’s

Why Integrate With Social API’s?

Billions of Information From Millions of Users

Hosted & Relatively Secure

Page 21: AIR & API

Adobe AIR and various API’s

Why Integrate With Social API’s?

Billions of Information From Millions of Users

Hosted & Relatively Secure

Integrate With Other Apps

Page 22: AIR & API

Adobe AIR and various API’s

Why Integrate With Social API’s?

Billions of Information From Millions of Users

Hosted & Relatively Secure

Integrate With Other Apps

It’s Simply Fun :)

Page 23: AIR & API

Part 02

Result Formats & Authentication

Working With API & ActionScript

Page 24: AIR & API

Result Formats & Authentication

Common Result Formats

Page 25: AIR & API

Result Formats & Authentication

Common Result Formats

XML (eXtensible Markup Language)

Page 26: AIR & API

Result Formats & Authentication

Common Result Formats

XML (eXtensible Markup Language)

JSON (Javascript Object Notation)

Page 27: AIR & API

Result Formats & Authentication

Common Result Formats

XML (eXtensible Markup Language)

JSON (Javascript Object Notation)

JSON is my personal favorite.

Page 28: AIR & API

Result Formats & Authentication

Common Result Formats

XML (eXtensible Markup Language)

JSON (Javascript Object Notation)

JSON is my personal favorite.

It’s fairly readable

Page 29: AIR & API

Result Formats & Authentication

Common Result Formats

XML (eXtensible Markup Language)

JSON (Javascript Object Notation)

JSON is my personal favorite.

It’s fairly readable

Readily parsed into array in ActionScript

Page 30: AIR & API

Result Formats & Authentication

Common Result Formats

XML (eXtensible Markup Language)

JSON (Javascript Object Notation)

The majority of social networks have JSON formatted API call result

JSON is my personal favorite.

It’s fairly readable

Readily parsed into array in ActionScript

Page 31: AIR & API

Result Formats & Authentication

Parsing JSON

An example of an API call result formatted as JSON[{"results":[

{"from_user_id_str":"27200872","profile_image_url":"http://a1.twimg.com/profile_images/1078865146/roa

sted-pepper_normal.jpg","created_at":"Tue, 18 Jan 2011 20:36:06

+0000","from_user":"masdennis","id_str":"27464269884821504","metadata":{"result_type":"recent"},"to_u

ser_id":null,"text":"RT @tubagus99: I'm Speaking on Adobe Flash Camp Indonesia

http://bit.ly/eGTfOn, see u

tomorrow..","id":27464269884821504,"from_user_id":27200872,"geo":null,"iso_language_code":"en","to_us

er_id_str":null,"source":"<a href="http://www.tweetdeck.com"

rel="nofollow">TweetDeck</a>"},{"from_user_id_str":"4809310","profile_image_url":"

http://a0.twimg.com/profile_images/1127731248/4square_normal.png","created_at":"Tue, 18 Jan 2011

18:25:12

+0000","from_user":"tubagus99","id_str":"27431327036866560","metadata":{"result_type":"recent"},"to_u

ser_id":null,"text":"I'm Speaking on Adobe Flash Camp Indonesia http://bit.ly/eGTfOn, see u

tomorrow..","id":27431327036866560,"from_user_id":4809310,"geo":null,"iso_language_code":"en","to_use

r_id_str":null,"source":"<a href="http://www.tweetdeck.com"

rel="nofollow">TweetDeck</a>"}...

http://search.twitter.com/search.json?q=adobe%20camp%20indonesia&rpp=50

Page 32: AIR & API

Result Formats & Authentication

Parsing JSON

The ActionScipt to convert the result into an array

_httpService.url = _apiCall;

_httpService.resultFormat = "text";

_httpService.addEventListener(ResultEvent.RESULT,resultTweets);

_httpService.send();

function resultTweets(event:ResultEvent):void {

_jsonResult = "[" + String(event.result) + "]";

var arr:Array = (JSON.decode(_jsonResult) as Array);

var rawResults:Array = arr[0].results;

_tweetsAC = new ArrayCollection(rawResults);

}

samples/json/parsing.mxml

Page 33: AIR & API

Result Formats & Authentication

Parsing JSON

Example App In Action

Page 34: AIR & API

Result Formats & Authentication

Authentication Methods

Page 35: AIR & API

Result Formats & Authentication

Authentication Methods

Basic HTTP

Page 36: AIR & API

Result Formats & Authentication

Authentication Methods

Basic HTTP

OpenID

Page 37: AIR & API

Result Formats & Authentication

Authentication Methods

Basic HTTP

OpenID

OAuth

Page 38: AIR & API

Result Formats & Authentication

Authenticating The App

Using ActionScript and OAuth protocol

Page 39: AIR & API

Result Formats & Authentication

Authenticating The App

Using ActionScript and OAuth protocol

CodeRanger’s OAuth library

Page 40: AIR & API

Result Formats & Authentication

Authenticating The App

Using ActionScript and OAuth protocol

CodeRanger’s OAuth library

Sample App In Action

samples/oauth

Page 41: AIR & API

Part 03

Let’s Build A Simple Game

The “GroupieSize” Game App

Page 42: AIR & API

Let’s Build A Simple Game

Game Concept

Page 43: AIR & API

Let’s Build A Simple Game

Game Concept

How Well Do You Know Currently Popular Musicians

Page 44: AIR & API

Let’s Build A Simple Game

Game Concept

How Well Do You Know Currently Popular Musicians

An Adobe AIR Desktop Application

Page 45: AIR & API

Let’s Build A Simple Game

Game Concept

How Well Do You Know Currently Popular Musicians

An Adobe AIR Desktop Application

Uses Data Collected from Last.fm

Page 46: AIR & API

Let’s Build A Simple Game

Core Codes

Get random artists information

samples/groupiesize/index.mxml

Page 47: AIR & API

Let’s Build A Simple Game

Core Codes

Get random artists information

samples/groupiesize/index.mxml

Get artists’ listeners count

Page 48: AIR & API

Let’s Build A Simple Game

Core Codes

Get random artists information

samples/groupiesize/index.mxml

Get artists’ listeners count

Display question

Page 49: AIR & API

Let’s Build A Simple Game

Core Codes

Get random artists information

samples/groupiesize/index.mxml

Get artists’ listeners count

Display question

Display answer and artists’ information

Page 50: AIR & API

Let’s Build A Simple Game

Core Codes

Get random artists information

samples/groupiesize/index.mxml

Get artists’ listeners count

Display question

Display answer and artists’ information

Record score

Page 51: AIR & API

Closing

Questions?

Page 52: AIR & API

Thank You

Developing Social Apps

Using Adobe AIR and Social Network API’s : AIR & API

about.me/arisetyo