33
Mobile Mashups! Over the Air - 4th April 2008 Owen Griffin, Vodafone Group R&D These slides are available on Google Docs

Over The Air Mobile Mashups

  • Upload
    snig178

  • View
    1.809

  • Download
    0

Embed Size (px)

DESCRIPTION

My slides from Over the Air, 4th-5th April 2008.

Citation preview

Page 1: Over The Air   Mobile Mashups

Mobile Mashups!Over the Air - 4th April 2008

Owen Griffin, Vodafone Group R&D

These slides are available on Google Docs

Page 2: Over The Air   Mobile Mashups

- Brief Introduction- Betavine- Web APIs- Web Mashups- Mobile Mashups

Page 3: Over The Air   Mobile Mashups

Who am I?

Page 4: Over The Air   Mobile Mashups

This is who I work for

Page 5: Over The Air   Mobile Mashups

Summertime in Newbury

Where I work...

Page 6: Over The Air   Mobile Mashups

What I do...

Research and Development

Page 7: Over The Air   Mobile Mashups

What do I do?

Page 8: Over The Air   Mobile Mashups

What I also do...

Page 9: Over The Air   Mobile Mashups

What do I do?

www.betavine.net

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

www.betavine.mobi

Page 10: Over The Air   Mobile Mashups

My web presence

FlickrPublish photoshttp://www.flickr.com/photos/snig/

GmailEmailhttp://www.gmail.com/

BloglinesRSS Aggregatorhttp://www.bloglines.com/

del.icio.usShare bookmarkshttp://del.icio.us/snig/

FacebookWaste timehttp://www.facebook.com/

Page 11: Over The Air   Mobile Mashups

Web API Example

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

Allows you to:Search photosFind contactsTransform photosContribute

Uses HTTP withSOAPJSONXML-RPCREST

Allows you to upload content from your mobile onto Flickr

Page 12: Over The Air   Mobile Mashups

Example Mashups

MashupsGoogleMaps mashups

Dart MapsBerkshire FloodsGoogle Maps Mania

Flickr MashupsRetrievrFastr

Page 13: Over The Air   Mobile Mashups

ServicesText Messages

Simple SMS messagesWAP Push links

Exchange of web linksApplication Trigger

Prompt J2ME applications to launchWindows Mobile library

Betavine Applications and DownloadsList applications by different attributes

CostCredit-based frameworkWhen you register you get 100 creditsTo get more email the webmaster

Overview

Page 14: Over The Air   Mobile Mashups

Test modeUses a Developer UAIDNo messages are sentNo credits are usedAllows you to test the response from the API

Authentication

Live modeUses a real UAID tied to Application and UserMessages are sent into the networkUser's credits are spentActive when a User downloads an application from Betavine

What is a UAID?User Application IDentifierUniquely identifiers a user to an application Allows an Application to send messages originating from the User without having any knowledge of their mobile number.

Page 15: Over The Air   Mobile Mashups

Response formats

PlainSimple plain textDesigned for simple translationQuick easy, and dirty

XMLSimple, well-formed documents

JSONJavascript Object NotationAllows you to easily use the API within web pages or widgets

To change the response format alter the suffix at the end of the API method URL.

Page 16: Over The Air   Mobile Mashups

Sending SMS

Method URL:http://www.betavine.net/api/send/sms.plain

Parameters:uaiddestmessage

Example Response:OK 1.1TRANSACTION 6176MESSAGE 5875 2008-03-28 14:25:09.0

Page 17: Over The Air   Mobile Mashups

Sending WAP push

Method URL:http://www.betavine.net/api/send/wappush.json

Parameters:uaiddestmessageurl

Example Response:{"response":{"transaction":{"id":6177,"messages":[{"sentAt":"2008-03-28 14:27:02.0","status":1,"id":5876}]},"status":"OK","method":"send\/wappush","version":"1.1"}}

Ugly code snippet!

Page 18: Over The Air   Mobile Mashups

Sending App Trigger

Method URL:http://www.betavine.net/api/send/trigger.xml

Parameters:uaiddestmessageport

Example Response:<response version="1.1"><method>send/trigger</method><status>OK</status><transaction><id>6178</id><messages><message><id>5877</id><status>1</status><deliveredAt/><sentAt>2008-03-28 14:48:09.0</sentAt></message></messages></transaction></response>

Ugly code snippet!

Page 19: Over The Air   Mobile Mashups

Message status

Method URL:http://www.betavine.net/api/send/status.plain

Parameters:uaidtransactionmessage

The response will contain a delivered-at property. It will only work if the mobile has delivery reports turned on.

Page 20: Over The Air   Mobile Mashups

API Application Usage

http://www.betavine.net/web/guest/projects/api/usage

Page 21: Over The Air   Mobile Mashups

API Method Usage

http://www.betavine.net/web/guest/projects/api/usage

Betavine does not log the

contents of any messages sent.

Page 22: Over The Air   Mobile Mashups

Mobile Mashup Example

I'm going to write a Facebook application, with

a Mobile client.

Page 23: Over The Air   Mobile Mashups

Uber Picture PokePoke your friends by showing them your photo on their mobile!

(because Facebook notification's aren't quite intrusive enough) Consists of 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 24: Over The Air   Mobile Mashups

Uber Picture Poke - MIDlet

What the UberPicturePoke MIDlet will do:Listen for trigger messagesOn receipt of a message1. Download the profile image2. Display the image to the user

Application Trigger messages sent by the API are Java Push messages.

It requires a Push Registry on the mobile. This is defined in MIDP 2.0 (JSR 118).

We'll need a compatible phone, such as the N95.

Page 25: Over The Air   Mobile Mashups

Listening for messages

JAD File Properties:MIDlet-Push-<n>

sms://:<port number>,<class>,<restriction>sms://:12345,net.betavine.UPPMidlet,*socket://:5000,AnotherMIDlet,192.168.1.50

MIDlet-Permissionsjavax.microedition.io.Connector.smsjavax.microedition.io.Connector.socketjavax.wireless.messaging.sms.receivejavax.wireless.messaging.sms.sendjavax.microedition.io.Connector.httpjavax.microedition.io.PushRegistry

Page 26: Over The Air   Mobile Mashups

MIDlet Push Registry

Implement MessageListenerpublic void notifyIncomingMessage(MessageConnection messageConnection);

Create a message connectionString url = sms://:1111";this.messageConnection = (MessageConnection) Connector.open(url);this.messageConnection.setMessageListener(this);

Check how the MIDlet was startedthis.connections = PushRegistry.listConnections(true);

Create a Thread which listens for new messages

Page 27: Over The Air   Mobile Mashups

Message Received

What happens when a message is received by our MIDlet. The run() method of our Thread.

Obtain the messageMessage message = this.messageConnection.receive();if (message == null) break; // OUCHTextMessage textMessage = (TextMessage) message;String text = textMessage.getPayloadText();

Display the Image in our FormHttpConnection connection = (HttpConnection) Connector.open(url);Image image = Image.createImage(connection.openInputStream());this.imageItem.setImage(image);

Page 28: Over The Air   Mobile Mashups

Facebook ApplicationThe 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 29: Over The Air   Mobile Mashups

Sending Messages using PHPSending the Application Trigger message:// Build the API call URL$url = "http://www.betavine.net/api/send/trigger.plain?";$url = $url . "uaid=" . $uaid;$url = $url . "&dest=" . $mobile;$url = $url . "&message=" . $picture;$url = $url . "&port=" . $port;

// Initialise CURL// DELETED

// Call the Betavine API with the generated URL$response = curl_exec($curl);

Page 30: Over The Air   Mobile Mashups

Uber Picture Poke - Demo

Page 31: Over The Air   Mobile Mashups

Uber Picture Poke - Demo

Page 32: Over The Air   Mobile Mashups

Future Additions

The Betavine API is a work-in-progess.

In the next few months you can expect the following:OAuth authenticationDevice capability queryApplication compatibility queriesLocation API

I am looking for beta-testers.. So contact me at [email protected] to give it a go.

Page 33: Over The Air   Mobile Mashups

References

- betavine.net developer resources

- betavine.mobi

- Reuters - Global cellphone penetration reaches 50 pct

- Social Network Usage Statistics

- Flickr API

- Facebook Developers