YOUR FEEDBACK
The Cloud Wars - Is Guitar Hero a Cloud?
Roland Judas wrote: I am following the cloud discussions for some months n...
AJAXWorld RIA Conference
$300 Savings Expire July 25
Register Today and SAVE!

READ DIGITAL EDITION


SYS-CON.TV

2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
TOP THREE LINKS YOU MUST CLICK ON


Messaging Is a Simple Game: Tic-Tac-Toe with SMS
Sybase 365 aids the delivery of nearly 6 billion messages each month

Digg This!

Page 2 of 2   « previous page

Think about it - SMS users are acting as message producers and consumers and are taking advantage of this transport in a number of ways.

  • Instant and reliable delivery,
  • Fire and forget
  • Store and forward
  • Seamless usage of technically disparate and geographically dispersed networks
These are all the sort of terms that enterprise messaging likes to use as well. So for a mobile architecture and a mobile application, such as one written with Sybase PocketBuilder v2.5, that wants to do some messaging, try using SMS. Remember your mobile worker may not always be within cellular access and that message needs to be acted upon as soon as they rejoin the network. Also the mobile application may need to send discrete pieces of information back to corporate systems or customers.

Hold on! I can hear you now... SMS messages are based upon text... Are they secure? These pieces of information can be coded or constructed in a way so that only the application creating or receiving the message would understand the message payload and be able to process it in a meaningful way, which will be good enough for most.

What about the real world? In my famous and IMHO ultimate PocketBuilder application, Insurance Assessor, the application used SMS in various ways. The Insurance Assessor could automatically send a message to the next customer while traveling to them or even send a message informing them of a slight delay. The application can also receive SMS messages from the back office that will either increase the priority of certain appointments or cause the application to connect and synchronize, maybe to receive new data. All of these messages were made up of identifiers that mean nothing to anything other than both systems.

An enhancement I've always though of adding is to have the application periodically SMS the latitude and longitude of the Assessor to the back office so that systems can keep track and maybe make intelligent decisions on whom to allocate new appointments to.

Question for you: Can you utilize this sort of messaging in your architecture?

How to Program for SMS?
For this article I have created a basic game as an example of sending, receiving, and processing SMS messages on a Windows Mobile device. The game should need no introduction other than its name - TicTacToe - nothing more basic that that! As you can see from Figure 1 and Figure 2 I have also used the updated Multiple Orientation Painter features of PocketBuilder 2.5 to make sure that it runs on many devices and orientations, such as the new HTC Touch device.

With PocketBuilder it's so easy to do as we can use the SMSSession object. The SMSSession object must first be opened with an SMSProtocol object that is a system structure that stores the data encoding and message mode of an SMS message (see Listing 1).

Now we can use the SMSSession object's one event, incommingmessage, which will be fired each time an SMS is received. For this event to be called, the PKSMSxx.DLL "shim" must be installed and registered with the operating system (see Listing 2). The event has two arguments of smsaddress and smsmessage. This is the area where we can code the process that will decide if it is a message we need to process for the application. Currently the best way is to look at the start of the message for some sort of identifier. If the identifier is found, the application can process the rest of the smsmessage and return either TRUE or FALSE. The return value of TRUE will prevent the message from entering the Windows Mobile Messaging "inbox" and FALSE to allow normal (default) processing to continue after our application code (see Listing 3).

The next point is to know how to send an SMS from within an application and again it centers on the SMSSession object. An SMSMessage object is a system structure that stores the text of an SMSMessage object and an SMSAddress object is a system structure that stores the address and address type of an SMSMessage object. Once all those are populated, the SMS can be sent with the Send function of the SMSSession object (see Listing 4). For the application, I chose an SMS address type of smsat_international! So the opponent's cellphone number at the top of the screen would need to be input via an edit mask in the form of +xx etc.

What is the logic behind the messages that power the game (see Figure 3)?

Once each player inputs their opponent's cellphone number and clicks the "Opponent" button, the game starts. The local player will always see their turn as an X and his opponent's turn as O. I'm not going to waste time showing or explaining the logic on how to check for a winning move, but rest assured that it is triggered after the player clicks on the screen to make a move - which triggers an SMS to be sent - or the application receives an SMS, which is the opponent's move. All the SMSs contain an identifier of "PKTTT:", followed by either "cellx" where x is the number of the cell 1-9 (top left to bottom right) or a question to play again, etc.

NOTE to SYS-CON the graphics above were taken from MS PowerPoint

Summary
Adding the innovation of SMS Messaging in your applications is so simple with PocketBuilder; it can increase the speed in which your business can react and in turn pass this quality of service onto your customers. Keep an eye on Sybase CodeXchange where I will post the application for your gaming pleasure.


Page 2 of 2   « previous page

About Ian Thain
In his customer facing role, Ian is very involved with the design, production and testing of Enterprise class UnWired Solutions, that have been implemented using Sybase's UnWired tools for Sybase customers around the globe. In addition, Ian is a dedicated technical expert continually working with Sybase's key partners and clients to enhance the capabilities of the UnWired solutions that Sybase can offer to its customers. As a five-year employee at Sybase, Inc. Ian has experience of working with the ITSG engineering teams, in particular on the EAServer, EP, PowerBuilder, PocketBuilder, PowerJ & OEM products. Amongst his many achievements, and deriving from his commitment to delivering hi-performance solutions, Ian was responsible for the design and implementation of the myPortfolio J2EE demo added to the EAServer distribution. Ian regularly addresses technical audiences all over the world providing profound technical knowledge, and has built up a reputation for being a knowledgeable speaker and his sessions are very well attended. He also writes whitepapers, demos and articles for various Sybase products and published in Journals such as PBDJ from SYS-CON (pbdj.sys-con.com). Ian is also the PocketBuilder Evangelist and works closely with the team in Concord, MA on new features and demonstration for the PocketBuilder product.

WIRELESS BUSINESS & TECHNOLOGY LATEST STORIES . . .
Adobe's Kevin Lynch and Microsoft's Scott Guthrie to Keynote AJAX World RIA Conference & Expo
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted to be
Troll-Evading Trust Formed To "Catch & Release" Patents
Verizon, Google, Cisco, HP, Motorola, Sun, Telefon AB and Ericsson have banded together as the Allied Security Trust to buy IP before any trolls can take them to court. They've paid $250k to join and are each kicking it about $5 million in funding. They will then get non-exclusive lice
ARC Wireless Solutions Announces the Official Launch of the Freedom Blade
ARC Wireless Solutions' Wireless Communications Solutions Division announces that the Freedom Blade and supporting Freedom Clip Pack have been fully launched and are now available to ship domestically and internationally via their retail and distributor partners. The Freedom Blade is t
Android Won't Be Home for Xmas
Android, due in the second half, could reportedly be delayed until Q4 or maybe even next year, according to the tale the Wall Street Journal tells, a situation that opens up a can of worms for Google. Google has to prove that it's more than a one-trick pony and that it can deliver some
Nokia Wants To Open-Source Symbian OS
Nokia wants to buy the 52% of the Symbian operating system that it doesn't already own to open source it and set it free. It's a defense against advances into the fragmented mobile space that Nokia and Symbian dominate - particularly - from the looks of case - against Google's nascent
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE