Tuesday, April 29, 2008

I've been using a Zebra QL240 Plus printer today to generate pallet labels.

This has saved me a tonne of time.   I've been creating my labels using Label Vista,   the bundled software that comes with Zebra printers.

Get the labels looking nice.   Test print them by hooking up a printer on your PC using USB.

Now here comes the time saving bit.    Save the label file in Label Vista.    Now add the resultant LBL file as content to your compact framework application's project file.    Then simply read the file in code and send it to the appropriate com port.

This way you get all the speed of a nice WYSIWYG environment, with all of the benefit of being able to then use these label format as is, in a mobile line of business solution.

I made a further refinement which searches and replaces any text field on my label to substitute in my own values.   so xxBARCODE becomes the barcode we want etc.

Tuesday, April 29, 2008 2:44:09 PM UTC  #    Comments [0]  | 
Sunday, April 27, 2008

Please notice,  that I've added an instant messaging link on the front page of my blog.   image

I'm using one of the new features of Live.    Link is Here.

I'm not sure if this is a good idea yet or not...  

Sunday, April 27, 2008 12:44:47 PM UTC  #    Comments [0]  | 
Friday, April 25, 2008

-41.241987 174.796904 TO 51.4420 0.75462

Thanks to my good friend Gareth Purchas,   the SQL Compact sync mission,   has just stepped up a gear.  

Tonight we did a SQL Compact sync, to Wellington in New Zealand.    That's a new record.

You can see the Virtual Earth Map by clicking here

Friday, April 25, 2008 9:32:51 PM UTC  #    Comments [0]  | 
Thursday, April 24, 2008

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 -

image

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.

image

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".   

 

image

The desktop application just for proof of concept also pops up each received text message, as follows -

image

More over the next few posts.  Send me a mail if you are interested in the complete source of this application.

Thursday, April 24, 2008 7:41:31 PM UTC  #    Comments [1]  | 
Tuesday, April 22, 2008

Nick Randolph (fellow device dev MVP) and I have just achieved something this evening/morning (depending on timezone).

We have used SQL Compact to synchronise a database all the way from Sidney Australia to the Sheerness UK.   That's a distance of 10,527 miles.

Here's the screenshot showing the synchronisation completing perfectly.

clip_image002

Thanks to Capespan's Kevin Cracknell's database that provided the sync. target.

You can see the Virtual Earth Map by clicking here

So just to recap,   this shows that a partially connected database application can be used with a back-end database running 10,527 miles away.

Technorati Tags:
Tuesday, April 22, 2008 9:53:38 PM UTC  #    Comments [0]  | 
Thursday, April 17, 2008

So,  like a lot of developers I know I have a failing.   I suffer from the if I didn't write it then I can't be bothered to go investigate someone else's code.   This rather selfish trait   was kicked into sharp focus this week when I saw Rob Tiffany demonstrate the Windows Mobile 2008 Accelerator.   He showed a nice clean set of building blocks for building some very cool mobile line of business applications.

Look at Rob's Blog Here

Download the accelerator Here

I'm battling my failings and I can clearly see that this is a great set of starting tools for anyone doing Mobile LOB.

Thursday, April 17, 2008 9:58:19 PM UTC  #    Comments [0]  | 
Tuesday, April 15, 2008

I'm sorry, the names are not even mentioned to protect the not so innocent..

So,   after a few glasses of Microsoft provided free wine,  I’m going to present what I think is the ultimate in geek story.

I’m sitting around a square boardroom table with the great and the good from both Microsoft and the MVP camp.   We’re discussing the lower level details of SQL Compact.   The large American fellow in front of me proceeds to effectively set up what can only be described as a ‘DataCentre’ in front of my very eyes.

First he unloads two laptops (top of the range Vaio and Dell Brick)

Followed by an ESata 2TB Raid array.

Followed by 5 USB external hard-drives

Plugs in Esata card to laptop

Plugs in USB hub

He is then asked if he has enough kit on the table (by a joking and scared) moderator for our group.

Oh no.  This is just the beginning.

Power supplies start getting plugged in.

Low voltage flight adapters, USB cables...

Jawbone headsets gets put into this guys ears.

He then caps the whole experience when the question gets raised in the session about Mac compatibility by offering to present the MacBook in his bag.

There’s me sitting just lapping it up, with my black and red book and an Anglia pen.

Big respect...  You know who you are....

Tuesday, April 15, 2008 5:25:41 AM UTC  #    Comments [0]  | 
Monday, April 14, 2008

IMAGE_021

So,  I'm in Seattle at the MVP summit.    This is a big event with some 3000 MVP's travelling in  worldwide.

This is the first hotel I've ever stayed in with a Starbucks coffee machine in the room...

Monday, April 14, 2008 2:08:21 PM UTC  #    Comments [0]  | 
Sunday, April 13, 2008

I just been able to perform a SQL Compact Merge replication from a Windows Mobile phone while standing in Seattle US to a server in Sheerness Kent, UK.    That's a distance of some 4,811 miles.

What scalable technology!

Click For Map

Performance was just as good as if I had been standing 1 mile from the server...

4,811 Miles miles to beat...

Sunday, April 13, 2008 5:19:00 PM UTC  #    Comments [0]  | 
Saturday, April 12, 2008

Good luck to Andy Wigley (fellow Device Dev MVP extraordinaire) and

Jeremy Palmer  (Microsoft good guy and extreme blogger) both running in tomorrows London Marathon

Big respect...

Saturday, April 12, 2008 6:52:55 AM UTC  #    Comments [0]  | 

I've been writing a mobile application that needs to run on a variety of different number of Windows Mobile and CE devices over the past few days.

The Visual Studio forms designer provides nice tools to like docking and anchoring of controls so all looks good on devices of different resolution or when the screen is rotated.

One area that you still have to cope with manually is assigning  the widths of columns in Datagrid's.     If you forget this step,  if you move from a 240x320 resolution PDA up to a 640x480 VGA device you end up with squashed columns.   So take this example.     If I run my application on the Windows Mobile 6.1 Professional Emulator (at 240x320) all looks well.

image

Now the same application, run on a VGA emulator (640x480) things all start to get squashed.

image

Of course you all know the reason for this.    Different Windows Mobiles screen resolutions have different dots per inch (DPI).

To factor for these different DPI's we need to scale our columns appropriately for  the current device type we are running on.

So the first thing we need todo is establish our current DPI.    There's a nice easy way to get this information.   I've wrapped this into a generic function as follows -

public static int DPI(Form frm)
       {
           SizeF currentScreen = frm.CurrentAutoScaleDimensions;
           int dpi = (int) currentScreen.Width;
           return dpi;
       }

So no a VGA device we get a DPI of 192,  on a 240x320 we get a return of 96.   So far so good.

Now we need a nice easy way of scaling our columns to fit appropriately  depending on our DPI value.  I'm making the assumption at this stage that most commonly we work in the Visual Studio designer on a form of 240x320 aka 96 dpi.   Anyway this is the scaling method I use -

public static int ResolutionScale(int scalevalue,int dpi)
        {
           if (dpi!=96)
                   return Convert.ToInt32(scalevalue * (dpi / 96));
           else
                   return scalevalue;
        }

Almost there.    Next step is to call our scaling function whenever we lay out our DataGrid.       This is achieved as follows -

public static DataGridTableStyle GridStyle(int dpi)
        {

            DataGridTableStyle ts = new DataGridTableStyle();
            ts.MappingName = "NameValuePairFormatted[]";

            DataGridColumnStyle tempcol = new DataGridTextBoxColumn();
            tempcol.MappingName = "NameLabel";
            tempcol.HeaderText = "Name";
            tempcol.Width = Core.ResolutionScale(112,dpi);

            ts.GridColumnStyles.Add(tempcol);

            tempcol = new DataGridTextBoxColumn();
            tempcol.MappingName = "Value";
            tempcol.HeaderText = "Value";
            tempcol.Width = Core.ResolutionScale(116,dpi);
            ts.GridColumnStyles.Add(tempcol);

            return ts;
        }

So putting it all together,    this is what my grid display code looks like -

int dpi = Core.DPI(this); // get the current DPI

         this.dataGrid1.TableStyles.Clear();
         this.dataGrid1.TableStyles.Add(NameValuePairFormatted.GridStyle(dpi)); // lay out our columns
         this.dataGrid1.DataSource = nvp; // bind and display our data

Final result on VGA device now looks like -

image

Thanks to Mike Holland who reminded me of this top tip.

Saturday, April 12, 2008 6:26:33 AM UTC  #    Comments [0]  | 
Saturday, April 05, 2008

I got asked the other day,  how I open Office 2007 (xlsx, docx, pptx) documents on a Windows Mobile device.

So acting as a public service,  here is the link to download the upgrade to Office Mobile.

http://www.microsoft.com/downloads/details.aspx?familyid=4B106C1F-51E2-42F0-BA32-69BB7E9A3814&displaylang=en

Saturday, April 05, 2008 9:19:43 AM UTC  #    Comments [0]  | 
Friday, April 04, 2008

I've been doing this for a while,   rather than talking a user through navigating to a given URL to install an application on their windows mobile device.

Send them an SMS, containing the URL.

Now this may sound obvious,  but using an SMS containing just a link to http://xyz.com/yourprogram.cab is really simple way to get an end user to install software.     Of course it has the added bonus of even working on a device that hasn't yet been provisioned to synchronise with mail yet.

image

Friday, April 04, 2008 7:54:18 AM UTC  #    Comments [0]  | 
Thursday, April 03, 2008

Wow,   this is what my emulator looks like today (actual size)

image

Thursday, April 03, 2008 8:12:53 PM UTC  #    Comments [0]  | 

Go download the emulator images here -

 

http://www.microsoft.com/downloads/details.aspx?FamilyID=3D6F581E-C093-4B15-AB0C-A2CE5BFFDB47&displaylang=en

 

Peter Foot,   beat me to it,  showing off some of the new screen resolutions -

http://inthehand.com/blogs/peterfoot/archive/2008/04/02/new-windows-mobile-6-1-screen-resolutions.aspx

The impressive one to have a look at is - 480x800 !

Thursday, April 03, 2008 8:06:22 AM UTC  #    Comments [0]  | 

Theme design by Jelle Druyts

Pick a theme: