24
Web APIs Tuesday Talk - Imperial College - 26-02- 08 Owen Griffin, Vodafone Group R&D These slides are available on Google Docs http://tiny.cc/D3HcM

Imperial Hack Evening

  • Upload
    snig178

  • View
    1.043

  • Download
    0

Embed Size (px)

DESCRIPTION

Slides from a demonstration at Imperial College.

Citation preview

Page 1: Imperial Hack Evening

Web APIsTuesday Talk - Imperial College - 26-02-

08Owen Griffin, Vodafone Group R&D

These slides are available on Google Docshttp://tiny.cc/D3HcM

Page 2: Imperial Hack Evening

- Quick Introduction- Mobile Development- Web APIs- Facebook Mashup- Other applications- Your ideas

Page 3: Imperial Hack Evening

This is who we work for

Page 4: Imperial Hack Evening

What's life like in R&D?

Page 5: Imperial Hack Evening

Summertime in Newbury

What's life like in R&D?

Page 6: Imperial Hack Evening

like these

APIsJavascript

Widgets

XHTMLXML

Ajax

SVGRuby on Rails

PHPJava

What do I do?

- Investigate Web Technologies

Page 7: Imperial Hack Evening

- Play with mobile devices

What do I do?

Page 8: Imperial Hack Evening

What do I do?

www.betavine.net

Member of the Betavine Development Team"An Open Community & Resource Website"

Page 9: Imperial Hack Evening

How many people own more than one mobile?

Zzzzz...

Questions

Page 10: Imperial Hack Evening

Has anyone done any mobile development before?

Questions

Page 11: Imperial Hack Evening

Has your application worked on more than 10 devices?

Questions

Page 12: Imperial Hack Evening

Mobile Development

- Worldwide mobile telephone subscriptions reached 3.3 billion- Thousands of different devices- Hundreds of different platforms- Too many choices for mobile development

Mobile Platforms- Windows Mobile- Symbian - Google Android- Apple iPhone- Java ME- Flash Mobile- Linux

Page 13: Imperial Hack Evening

Web Development

Easier than mobile development? Less devices, less platforms?

More developers and a larger audience?

Is the Web Browser a platform?

Page 14: Imperial Hack Evening

Web APIsAll the web sites mentioned before allow their users to access their information through an API.

There are 1000's of mini-applications on the web which make use of publically available Web APIs.

E.g.

http://www.flickr.com/services/api/

Allows you to:Search photosFind contactsTransform photosContribute

Uses HTTP withSOAPJSONXML-RPCREST

Page 15: Imperial Hack Evening

What can be done with Web APIs?

MashupsGoogleMaps mashups

Berkshire Floods1000's @ Google Maps Mania

Flickr MashupsRetrievrFastr

Social Network "Applications"Facebook applicationsOpenSocial

Page 16: Imperial Hack Evening

Services:Text Messages

Simple SMS messagesWAP Push links

Exchange of web linksApplication Trigger

Prompt applications to load on the phoneSupported formats:

JSONXMLRSSPlain text

Designed with mobile applications in mind. Simplistic - doesn't use a traditional authentication model. Read More..

Page 17: Imperial Hack Evening

Mobile Mashup Example

- Facebook, Bebo and MySpace, accounted for 5.17% of all UK Internet visits during October 2007

- So lets write a Facebook application...

Has anyone written a Facebook application before?

Page 18: Imperial Hack Evening

Uber Picture Poke

- Allows you to Poke your friends by showing them a photo of yourself on their mobile

- Requires both a Java Mobile MIDlet and a Facebook application

-The Facebook application uses the Betavine API to send an Application Trigger message to the MIDlet. The message contains a URL to an image. The image is downloaded and displayed on the mobile.

- http://apps.facebook.com/uberpicturepoke/

Page 19: Imperial Hack Evening

Uber Picture Poke - MIDlet

What we need to do:- Listen for messages- Download an image- Display an image

Lets just look at some code...

Has anyone written a MIDlet before?

Page 20: Imperial Hack Evening

Uber Picture Poke - FacebookThe Facebook application needs to:- List all of our friends which also have this application- Send an Application Trigger message to the MIDlet

Facebook API is extensive.. - http://developer.facebook.com/

The method we need is- Friends.getAppUsers

There is a helpful PHP library which interfaces with the API.

Facebook allows us access to all sorts of information, but.. does not let us find the users' mobile number.

Page 21: Imperial Hack Evening

Uber Picture Poke - Demo

Page 22: Imperial Hack Evening

Uber Picture Poke - FacebookSending the Application Trigger message:$url = "http://www.vodafonebetavine.net/api/send/trigger.plain?uaid=" . $uaid . "&dest=" . $mobile . "&message=" . $picture . "&port=" . $port;

$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);curl_setopt($curl, CURLOPT_TIMEOUT, 4);$response = curl_exec($curl);$error = curl_errno($curl);$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);if ($error != 0 || $httpcode != 200) { echo $response;} else { echo "<p>Poking.. " . $mobile . "</p>";}

Page 23: Imperial Hack Evening

Uber Picture Poke - Demo

Page 24: Imperial Hack Evening

References

- betavine.net developer resources

- betavine.mobi

- Reuters - Global cellphone penetration reaches 50 pct

- Social Network Usage Statistics

- Flickr API

- Facebook Developers