Monday, June 30, 2008

Today we needed a low cost way of sending bulk SMS messages.   With the advent of low and even free message deals,  I thought what about just hooking up an old Windows Mobile device to send messages on our behalf.

Hooking a phone up to a PC with a USB cable and a bit of socket programming to listen to request to send messages.   So on the device we have this listener.

 

image

We send messages on a TCP port in the form PHONENUMBERS|MESSAGE

Phone picks up the message and sends the SMS using this bit of code.

 

                           OutlookSession currentSession = new OutlookSession();
                            SmsMessage smsmess = new SmsMessage();
                            smsmess.Body = message;
                            foreach (string num in numbers)
                                smsmess.To.Add(new Recipient(num));
                            currentSession.SmsAccount.Send(smsmess);
                            currentSession.Dispose();

 

The whole process is invoked by a command line application on the PC, which takes the following command line -

SMSIT <ip address of phone> <phonenumbers> <message>

This application just opens a TCP socket connection to the phone and squirts down the PHONENUMBER|MESSAGE

Job done,  I can now send SMS from lots of different desktop and server applications

Monday, June 30, 2008 4:18:40 PM UTC  #    Comments [0]  | 
Tuesday, June 24, 2008

Today I needed to quickly do some screen mock ups for a customer.   Rather than lay out yet another mobile form with labels down the left (right aligned and prettied up) and text labels on the left (left aligned and prettied up),  I thought I would create myself some templates.

I’ve now got a set of all the most common ones I need -

 

image

Its really easy to-do and saves you a pile of time.

Here’s an example of my base form -

image

All you need todo in Visual Studio from the File menu is select Export Template, then follow the wizard through.

You can then tidy up the resultant templates by looking in

%userprofile%\Documents\Visual Studio 2008\My Exported Templates

A nice little tip, I found is that when you create a new instance of your template if you put the string

$safeitemname$

In the template file, it will substitute your class name in where you need it, great for setting window titles etc.

Finally zip up the contents of your template and copy to

%userprofile%\Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#

You can of course do the same for VB.net etc.

 

My only final tip, is to make sure you get your object (form etc.) right before you export it,  its a pain to edit templates.   Not impossible just a flaff.

Tuesday, June 24, 2008 2:07:38 PM UTC  #    Comments [0]  | 
Saturday, June 21, 2008

I know I’ve been banging on about this a fair bit.    But we are at T Minus 14 days till I attempt the worlds first Virtual Earth Powered Balloon Race, well actually its Helium powered but you get the idea.

If you want to be part of this,  go buy a ticket at www.racingballoon.com

Saturday, June 21, 2008 11:38:19 AM UTC  #    Comments [0]  | 
Friday, June 20, 2008

Ok,  so here’s the scoop.

I’ve been playing around with adding location EXIF tags to a photo taken on a Windows Mobile device.  I’ve reached the conclusion that reading tags is not that difficult but writing them can be a pain in the bottom.

So, I’m thinking, about using a web-service to post pictures from the mobile device along with the location the picture was taken and letting the full framework add the required EXIF tags and save it to the photo sharing/blog of your choice.

So its early days (as I’m a newbie to this),  but here's the bit of full framework code that lists the EXIF tags and the bit commented out at the bottom shows how to add a simple tag.

            Image theImage = new Bitmap(@"someimage.jpg");

            // Get the PropertyItems property from image.
            PropertyItem[] propItems = theImage.PropertyItems;

            foreach (PropertyItem i in propItems)
            {
                if (i.Type == 2 ) // strings at the moment
                {
                    Debug.WriteLine(i.Id + " " + i.Type + " " + ASCIIEncoding.ASCII.GetString(i.Value));
                    Debug.WriteLine("");
                }
                else
                {
                    Debug.WriteLine(i.Id + " " + i.Type + " " + i.Value.Length);

                }

            }
            
            // adding a new tag
            // PropertyItem p = new PropertyItem();

            // theImage.SetPropertyItem();
            

Anyway,  we’ll see how this progresses.

Friday, June 20, 2008 4:35:03 PM UTC  #    Comments [0]  | 
Thursday, June 19, 2008

Another just wow moment. (watch from about the halfway point)

http://www.gottabemobile.com/GBM+Shortcut+Live+Labs+Seadragon+On+Surface.aspx

Thursday, June 19, 2008 7:29:16 PM UTC  #    Comments [0]  | 
Tuesday, June 17, 2008

This looks cool (and new),   NavReady - The next generation of portable navigation devices.

http://www.microsoft.com/windows/embedded/products/navready/default.mspx

Tuesday, June 17, 2008 8:58:49 PM UTC  #    Comments [0]  | 

So here’s the problem.    Today’s sudden emergency, we found a bug with a mobile application.    The bug was traced quickly to a small typo in a web-service.    I was in my office miles away from the client,  yes I had sloooow VPN access but I needed to get a fix quickly deployed to all nodes on a three machine load balanced IIS farm.

So this is what I did.

In Visual Studio, I published my website to a local folder on my hard disk.    I then removed the web.config as  didn’t need the pressure of having to rebuild the configuration for all environments.

I then file copied this up to a test machine, got the customer to test and confirm that I’d fixed the problem.

Next step,  was to use a batch file (and this is the nugget) to restart each IIS server in turn  (using iisreset) and copy the files from test to production across each server.

Having a batch file to achieve this stopped me having to type lots of commands under pressure.   Common sense stuff I know, but this really saved my bacon today.

Total time for fix,  around 15 minutes.     The world keeps turning :-)

Tuesday, June 17, 2008 8:48:25 PM UTC  #    Comments [0]  | 
Friday, June 13, 2008

Got a spare £1600 for a PDA?

Go buy yourselves one of these babies.   All my mobile software looks great on these as its got twice the clock speed of most normal high end rugged devices (i.e 800 Mhz)

 

image

These are military grade machines that I’m sure could take a bullet or two.   The picture doesn’t really do it justice  they are chunky and very well made.  The VGA screen,camera and barcode reader are all just superb.  Not forgetting its routes in high end field survey,  so it has a top of the line inbuilt GPS.

Lets just say £1600 one more time…  

 

Want one

 

Technorati Tags: ,
Friday, June 13, 2008 10:51:30 PM UTC  #    Comments [0]  | 
Thursday, June 12, 2008

OMG!   This is just out of this world.

http://deepzoom.soulclients.com/VE/

Thursday, June 12, 2008 10:38:00 PM UTC  #    Comments [0]  | 

This is very cool.    Want a map that you can quickly display on a mobile application?

Now I believe to the letter of the law you need a Mappoint.Net licence to use this legally.   But that aside,  lets just look at the tech.  for displaying a map from Virtual Earth as a flat image that can be rendered easily on a mobile application.

Like -

I kind of reverse engineered the URL from -

http://api.tiles.virtualearth.net/api/GetMap.ashx?b=r,device.mobile&op=0,,52.1439066666667,0.0902583333333333&c=52.1439066666667,0.0902583333333333&w=175&h=175&z=14

If you look at the URL,  you can see that I have a long/lat for both the centre of the map and a pushpin.

Very easy to add to any mobile line of business application.   Just check with your licensing people first before using in anything production.  

 

Thursday, June 12, 2008 3:18:43 PM UTC  #    Comments [1]  | 
Tuesday, June 10, 2008

A few people have commented about my GPSPhone application,  a few people are struggling to install it.

The GPS Phone application is here

http://www.binaryrefinery.com/main/www.binaryrefinery.com/main/content/binary/gpsphone.cab

 

You need the SQL Compact runtime to get the application, which you can download from

http://www.microsoft.com/downloads/details.aspx?FamilyID=38ed2670-a70a-43b3-87f3-7ab67b56cbf2&displaylang=en

 

Trust me, its worth the pain :-)

Tuesday, June 10, 2008 7:31:39 PM UTC  #    Comments [0]  | 

No sooner had I blogged about my cross-platform I-Ching test application running under Safari.    Its up on www.apple.com.    You’d think those Apple people would be busy at the moment. :-)   Anyway,  thank you very much.

Link here - http://www.apple.com/webapps/entertainment/mobileichingreadings.html

image

Tuesday, June 10, 2008 12:19:08 PM UTC  #    Comments [0]  | 

This is fairly nice.  I didn’t realise there was a standard for geotagging any website.    As location plays more and more an important role in the world of the mobile web,  I figured now was a good time to start adding a bit of location information to my site.

It works by adding some meta tags to the head of your web-pages,  i.e

<meta name="geo.region" content="GB-CAM" />
<meta name="geo.placename" content="Cambridge" />
<meta name="geo.position" content="52.26542;0.18947" />
<meta name="ICBM" content="52.26542, 0.18947" />

I found a really quick way of generating the tags using this site -

http://www.geo-tag.de/generator/en.html

Next mission to work out which search engine can read the tags.

Technorati Tags: ,

Tuesday, June 10, 2008 9:30:39 AM UTC  #    Comments [1]  | 
Sunday, June 08, 2008

Sorry guys,  I’ve sold out a bit….

Well actually due to the high costs of electricity,  I’ve made the difficult decision to carry a couple of banner ads on my blog.   

As you all know,  I’m hosting this from my a small PC pretending to be a server around the clock.    So please click a couple of my adverts and it may help pay for the recent doubling of my electricity bill.

I hope you don’t mind..

Thanks

 

Richard

Sunday, June 08, 2008 10:31:58 AM UTC  #    Comments [0]  | 

Whenever a new device or sector appears   I like to produce a reference application, just to see what the development experience is like.

For years this has been an I-Ching fortune telling application (don’t ask me why).

Anyway to test cross browser compatibility between Windows Mobile and Apple Webkit,   I’ve just ported this old app.     Its a web-application, so fairly simple to port.

I just added a style-sheet reference and using an ASP.NET master page, was able to add the proprietary viewport tags to the head section, to make things look right on iPhone,  as follows -

<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>

 

I’ve also used this code chunk to automatically redirect if we are coming in from an Apple device -

       bool isiphone = false;
       bool isipod = false;

      try
        {
            isiphone = (Request.UserAgent.IndexOf("iPhone;") != -1);
            isipod = (Request.UserAgent.IndexOf("iPod;") != -1);
        }
        catch
        {

        }

        if (isiphone || isipod)
        {
            Response.Redirect("iphone");
        }

So if you’re interested point your browser to http://www.binaryrefinery.com/i-ching

I’m the first to admit, I don’t have the patience to-do the full beautiful user interface that maybe this application deserves,  but here’s the result -

 

image

So porting experience fairly simple,    I notice that unlike Windows Mobile the HTML buttons on Safari don’t wrap very nicely,  so you end up with loooong  thin buttons.    Oh well, something else to work on….

Hope your all having a great weekend.

 

Technorati Tags: ,,
Sunday, June 08, 2008 9:11:36 AM UTC  #    Comments [0]  | 
Wednesday, June 04, 2008
Sunday, June 01, 2008

I've been doing this for a bit now.   If my mobile applications encounter any kind of error,  be it in program code,  or some unforeseen problem  I make my mobile applications send me an email.

I do this, by calling a web-service, which means I don't have to open any other ports for SMTP mail or such like.   Happy to share source, for anyone that's interested -

 

 

Here's a sample email -

Field

Value

 

User:

OUR USER

 

Scanner:

030 (10.2.106.3)

 

Scanner Type:

SYMBOL MC9090K

 

Location:

BWYVACREC

 

Profile:

LIVE GSRFAPPFARM

 

Screen:

Pallet Reverse Stock

 

Date:

01/06/2008 19:44

 

Scanner Version:

1.0.5.6

 

Errors from JDE = Error: Item Not In Receipt Location (BWYWPH, BWYVACREC) (9999) Input Parameters = Lot = 12225959,Location = BWYVACREC,Quantity On Hand = 52

Sunday, June 01, 2008 7:05:21 PM UTC  #    Comments [0]  | 

Theme design by Jelle Druyts

Pick a theme: