I've been on a bit of a mission for the past few days. A friend of mine asked how easy it would be to build a system that accepted text messages and was able to respond back to the sender. So I got thinking, radio stations and TV do this all the time. Text "VOTE BOB", to 83232332 to evict Bob from the Big Brother House. Or nightclubs let you text the DJ for what to play next. So how could you build a simple desktop application that could process and respond to text messages? I'm going to take the next few posts to cover a solution to this problem.
I'm sure, you can see where this all going; doing windows mobile line of business we have all the pieces. Firstly using SMS message interception, we are able to capture any incoming text message and process it ourselves. So first job was to build a Windows Mobile Line Of Business application to listen to the incoming texts. Here's one that I prepared earlier -
This application captures any incoming text message with the magic bit of Compact Framework code -
interceptor = new MessageInterceptor(); interceptor.InterceptionAction = InterceptionAction.NotifyAndDelete; interceptor.MessageReceived += new MessageInterceptorEventHandler(interceptor_MessageReceived);
Next step we need to pass the contents of any text message over to a desktop PC for processing. Now I now this isn't truly in the spirit of mobile line of business, where we normally do everything on the device, but at 2am in a crowded nightclub, its probably better to pass the messages over to a desktop PC for handling. Of course their are many ways to achieve the Windows Mobile to desktop connectivity. I opted in the end for raw TCP/IP socket programming, which lets me use the setup either over an ActiveSync/Windows Mobile Device Centre with a cable from the mobile device or a wireless connection.
Here's the desktop side of things, listening for incoming messages.
Now its not pretty 'yet' and I haven't got it displaying a bar graph or counting votes, but the mechanism for collecting and responding to text messages is all in place.
So lets give it a run. Now being frugal I thought I'd save myself lots of cash and use the Windows Mobile 6 SDK, Cellular emulator to send fake text messages to my phone emulator. So I've sent "Vote Bob", to my phone. I get an text message response back to me, saying "Thank you for you're vote".
The desktop application just for proof of concept also pops up each received text message, as follows -
More over the next few posts. Send me a mail if you are interested in the complete source of this application.
Theme design by Jelle Druyts
Pick a theme: BlogXP calmBlue
My Virtual Earth Balloon Races www.racingballoon.com Richard JonesPowered By The Fridge Server