Friday, September 28, 2007

Today I was asked whether as well as a Symbol barcode scanner, my application could also run on an Intermec device.    Being both Windows Mobile 5, I figured that shouldn't be much of a big deal.

However as ever the only difference between the two machines was the drivers for the barcode scanners.    I didn't fancy having to have a Symbol and Intermec version of my code.   So I went for it and did what I've been meaning to-do for a while build an abstract class that I could use as a prototype for supporting any type of barcode reader.   This is what I came up with -

public abstract class Scanner
    {
        public event ScanEventHandler Scan;

        public delegate void ScanEventHandler(object sender, string data);

        public abstract void Start();
        public abstract void Stop();

        protected bool started = false;
        protected void doscan(string txt)
        {
            if (Scan != null) Scan(this, txt);
        }
    }

 

I then wrote a class that implemented the code required to support each barcode reader type -

i.e

public class ScanningSymbol:Scanner
{

// gubbins of code in here

}

I had to of course implement the start and stop methods, when I want the event raised to tell us when we have received a bardcode call doscan(barcodetext)

 

I had to also implement a dummy class that coped with a device without a barcode reader, i.e the device emulator.

The final part of the implementation is to automatically decide which barcode reader the device has built in/attached,  but we'll cover that next time.

Friday, September 28, 2007 9:04:42 PM UTC  #    Comments [0]  | 

Now this is interesting.   I've often wondered why about 10 minutes before doing any demo.  the Windows Mobile device emulator fails to connect to the Internet.    More annoyingly the closer to the demonstration the more likelihood of such occurrence taking place.      Today maybe I've come closer to working out why this law stands, and may I pray be the end to the last minute demo nightmare.

I'm sure that this is well documented and very obvious,  but I'd never noticed it before.    When you cradle a mobile device (using the device emulator manager),   the mobile device acquires the proxy server of the Internet connection you are using, as follows -

image

This can cause all sorts of grief if say the mobile application you are using connects to SQL Compact server by IP address or if your using web-services.

So apart from remembering to go into your connection settings and uncheck the second checkbox,  today I came up with a way that would make you proxy proof.    To avoid the 10 minute demo nightmare we need a way to tell in our application to ignore this inherited proxy settings.  This is an example of calling a web-service by its IP address.   I use a static class to take the pain out of building a reference to our webservice -

public static gsqa01.RA WS()
     {
         gsqa01.RA ret = new gsqa01.RA();
         ret.Url =
http://10.0.0.1/test/test.asmx";
         ret.Credentials = WSCreds(); // go get our authentication
         ret.PreAuthenticate = true;
         ret.Proxy = new WebProxy(); // ignore the standard proxy
         return ret;
     }

Its exactly the same deal with SQL Compact replication.  I did a demo today  and I'm pleased to say the demo went smoothly and proxy problem free.

Friday, September 28, 2007 8:32:13 PM UTC  #    Comments [0]  | 
Sunday, September 23, 2007

Now this just seems a tad under hand/clever.

http://www.apple.com/itunes/starbucks

Funny that Seattle is one of Apple's first targets.

Darn you, you smart marketing people you...

Sunday, September 23, 2007 8:02:38 PM UTC  #    Comments [0]  | 
Friday, September 21, 2007

Check out this fab piece. on Data Caching.

We all could learn something here :-)

http://community.opennetcf.com/articles/cf/archive/2007/09/21/improving-data-access-performance-with-data-caching.aspx

Friday, September 21, 2007 7:14:54 PM UTC  #    Comments [0]  | 
Thursday, September 20, 2007

Last night,  I posted to the suggestion box on Windows Mobile about features I'd like to add to the next release.

If you'd like to-do the same goto -

Https://forums.microsoft.com/WindowsMobile/ShowForum.aspx?ForumID=1595&SiteID=65

Here's my list  -

1) Pocket IE - Allow a web-site to request the location of the device.        Obviously Pocket IE would need to throw up a confirmation prompt to allow the user to allow/disallow this.   The GPS intermediate driver could be used for this, with a small inbuilt ActiveX.    This would be a great addition as more devices come out with GPS's inbuilt and let web site designers really factor in location.

2) Provide a generic API (managed) for barcode/RFID readers.   I'm fed up with having to write difference code for Symbol, Intermec, Psion etc...

3) Pocket IE - Allow in pocket IE, an html input box to be marked that you wish for a barcode to be dropped into that field (and tell the device to switch barcode reader on for that page).   This would open up a tonne of field service applications that traditionally have to be developed as an application running on the device.

4) Let SQL Compact, be able to synchronise the clock of the device on replication.

5) Allow for a silent install of cab files.  I don't like prompting end users for where to install cab, etc.

6) Tidy up cab installer,  I hate that all the confirmation is on the bottom of the screen apart from last prompt, which is an OK top right.

7) Tidy up the network setup stuff.   The days of modems and ISP settings are over.

) Pocket IE support for Vcard, VCAL mime type.

9) Pocket IE - ability to assign favourites to speed dials

10) Pocket IE - hints on input controls to switch on SIP

11) Pocket IE - allow controls to have a regex mask on input, i.e a textbox that allows numerics only  etc.

12) Make Windows Mobile a Sideshow device when docked, or even on LAN.

13) Silverlight mobile plugin,  maybe I'm asking too much ?

14) Beef up GPS intermediate driver.   Allow control panel to auto find hardware port of GPS device.   Provide a simpler way for end users connecting GPS.    End users don't know what a com port is!.  Don't let OEM's disable this feature.

15) Alarm clock - give an option to set for one instance only.

16) Ability to switch off pin/password lock   when in car/handsfree bluetooth profile.   This would save road accidents!

17) Oh go on, (blast from the past)  make IRDA able to be able to control my hifi, part of the base hardware spec. :-)

18) Put a device into clock radio mode.   I remember the original SPOT demo.   Surely when the alarm goes off in the morning, you could display schedule for the day etc.   Have you seen the Chumby project?

19) RSS support - and an RSS screen saver.

20) Support for Sidebar gadgets - new today screen.

21) Provide the ability to add geo-encoded location information from GPS intermediate driver when taking a picture using onboard camera.  i.e embedded EXIF tags into all WM mobile photos.

22) Pocket IE - allow file upload control to work, in HTML.   This would be great for uploading photos to blogs etc.

23) Pocket IE - provide a control to provide picking a photo, and uploading (similar to above), but designed just for photo video upload.

24) Make it standard that a WM device can be a HID bluetooth controller.   I.e let a phone be a powerpoint controller for a P.C

25) Provide support to hook upto network projectors.

26) Support USB host control, so USB keys and hard disks can be plugged in.   Think of the music/video playing potential.

27) Windows Live Barcode!!!  QR codes,  we need you...   + some standard (managed) API for near field communication.

28) Let active-sync/Windows Mobile Sync centre - support device camera's as if they were webcams.

29) Let active-sync/Windows Mobile Sync centre - support device GPS's as if they were serial/USB attached GPS devices.

30) Add the ability to send location (from GPS intermediate driver), to an email recipient.   i.e send a link to a live map substituting co-ordinates into query string.   This would be a great advert for virtual earth too.

31) Support alarms and custom actions (calling a web-page, running and app) when a user leaves or enters a geo-fence.   Users can setup their own geo-fences.

32) Make device a UPNP music/video source.

Thursday, September 20, 2007 8:54:32 AM UTC  #    Comments [0]  | 
Monday, September 17, 2007

 

The BBC did a feature on QR tags during this weeks Click TV programme.

Just a reminder.  I put up a few months go a FREE web-service for generating your own tags.

Its over here if you need it.

Its very easy to use from Visual Studio and just a question of adding a single web-reference.

Go on, you know you want it...

 

Technorati Tags: ,
Monday, September 17, 2007 12:50:28 PM UTC  #    Comments [0]  | 
Saturday, September 15, 2007

I've spent the last 3 days on a mission to get JD Edwards to receive function call requests via XML.    Now I know I've been talking web-services vs. direct database connections for a bit.   But seeing the results of invoking a complex business process from a mobile device kind of negates that argument.

JD Edwards systems integration does seem a bit of a black art, configuring application servers and understanding some very non MS terms makes this all the more challenging (for an MS boy like me anyway).    However once configured you have the most amazing scope of what you can go on and build.

I've been spending some time now building tools that will automatically construct the function calls in JDE XML specific format. 

Like this -

JDEDoc g = new JDEDoc("XMLtest", JDEDoc.JDEType.Callmethod);
g.CallMethod("HelloWorld", true, true);
g.AddParameter("mnUniqueKeyIDInternal_UKID", 111);
g.AddParameter("szDescription001_DL01", "Hello JDE");

string ourrest = g.Execute();

Technorati Tags: ,

Saturday, September 15, 2007 9:51:32 PM UTC  #    Comments [0]  | 

I figured it was time to pimp my mobile I-Ching programming example and add some mobile AJAX.

image

I wanted on the button  presses not to have to reload the page but to just trigger a behind the scenes AJAX call to go get the data I needed.    I then asynchronously drop the results back into the contents of a <DIV> tag in the page.  Have a look at

www.binaryrefinery.com/i-ching/ajax

Do a view source on the page to see what's going on.

Also note that this is all cross browser aware so it will work on Windows Mobile, I.E, Safari/iPhone etc.

Saturday, September 15, 2007 9:32:54 PM UTC  #    Comments [0]  | 

So I'm getting a few emails about how to get the Ickle Web-Server running on the Windows Mobile emulator but being able to be connected from a desktop browser.

Here are the steps I followed to make this dream a reality.   The first thing I found you need is the Microsoft Loopback network adapter installed on your machine.

I found some instructions that explain how to do this -

http://www.windowsnetworking.com/articles_tutorials/Install-Microsoft-Loopback-adapter-Windows-XP.html

Vista is pretty much (slight poetic license) the same procedure.

In my case I set the IP address of the loopback adapter to 10.100.0.1 with a subnet mask of 255.0.0.0

Make sure, you don't pick an address that is even close to any network that you use.

 

Next its time to configure the Emulator to use the loopback adapter.   Fire up say the Windows Mobile 6, professional emulator and select from the emulator properties.   As follows -

emulator properties

Ok, almost there...   

Next you have to configure the emulator to also have a fixed ip address.   I opted for 10.100.0.2.   This is done inside the emulator on the network settings as follows -

image

And the network address at -

image

Ok, at this stage click OK (top right) .  I then did a soft reset on the emulator.   On your desktop PC you should now be able to ping 10.100.0.0.2.

 image

Now I confess the above step didn't go that smoothly.  It took a few reboots to get this all sorted,.    I also found out that on one machine, I needed to get the required networking components namely 'Virtual Machine Network Services'.   See below.

 

 image

I resolved this by downloading Virtual PC 2007,  which did the trick fine.   VPC can be downloaded at - http://www.microsoft.com/downloads/details.aspx?FamilyID=04d26402-3199-48a3-afa2-2dc0b40a73b6&DisplayLang=en

 

Ok, back to our pinging Windows Mobile device.    Next step is to run up the Ickle web-server.      If you haven't downloaded it yet get it here

In Visual Studio, when you run the Ickle web-server you'll see on the output window what address its listening on -

image

So lastly,   lets try and connect to the Ickle web-server on your desktop browser.   Long pause and some more frustration later, a few reboots and (some how).    You'll get -

 

image

 

So there you have it.   Its seems that the above is a little bit of a fight to get going, but if you need it, it is possible.    

Saturday, September 15, 2007 9:11:23 PM UTC  #    Comments [0]  | 
Monday, September 10, 2007

So I got thinking the other day (as you do),  wouldn't it be great if when I take a picture on my Windows Mobile device I could embed in the image the location of where I took the photo, i.e the longitude and latitude from a GPS.

So reading around the web,  it looks like there is an already an established way of adding location and other meta information to a JPEG and a whole host of other image formats known as EXIF.

Furthermore tools like Google's Picasa let you take your photo collection and with the correct EXIF tags hidden away in your image lets you see your holiday snaps plotted directly on a map.    Other photo services like Flickr also comprehensively support geo-encoded pictures.  

So what's out there in the world of Windows Mobile to support such an established standard?   Answer, not much that I can find. 

Mark Arteaga  (of Opennetcf fame) did a piece a while back one reading the tags see - http://blog.opennetcf.org/marteaga/default,month,2007-02.aspx

Mark's solution is great getting close to what I'm trying to achieve however it doesn't write the tags (doh) just reads.

So further investigation reveals some good Perl libraries the do the job which could be wrapped into a web-service.  Such as Phil Harvey's ExifTool at -

http://www.sno.phy.queensu.ca/~phil/exiftool/

In a addition other tools that will take a track from a GPS and using the timestamp of the photo and achieve the geo-encoding result such as -

http://www.robogeo.com/home/

However we are still missing the holy grail of being able to encode as we take the picture on the device.    Maybe its time for a community project guys?

Monday, September 10, 2007 8:56:38 PM UTC  #    Comments [0]  | 

Today I'm facing somewhat of a dilemma.    I have a customer that is needing the fastest possible access to a bunch of business objects called from a mobile application.

We're talking looking up products in a catalogue moving stock around between locations.

In my heart I want to-do this all with web services as I crave the simplicity of changing this app from a WIFI based LAN application to something that I can deliver over GPRS/3G with no hassle.

However my head is telling me that web-services and their XML payload (uncompressed) adds a significant over head.   Tomorrow its time for a speed trial....

Monday, September 10, 2007 7:16:10 PM UTC  #    Comments [0]  | 
Sunday, September 09, 2007

This is a temporary post that was not deleted. Please delete this manually. (a2ab6b89-f517-4dee-88ec-a8e19131c376)

Sunday, September 09, 2007 7:10:34 PM UTC  #    Comments [0]  | 

Theme design by Jelle Druyts

Pick a theme: