February 2006 Entries
The following is a step by step for configuring the GlobalSat BT-338 with a Windows Mobile 5 device (such as the K-Jam or QTEK 9100). However this should work with any bluetooth Gps and WM5 device.
Pairing the Bluetooth Gps with WM5
- Open the Comm Manager in programs or from the Today Screen
- Turn on Bluetooth
- Select Settings > Bluetooth Settings
- Click the Devices Tab
- Click New Partnership (ensure your Gps is on first)
- You may be prompted for a passkey - the BT-338 uses: 0000
- Click Finish
- Click the COM Ports tab (shown below)
- Click New Outgoing Port, select the BT device, then the COM port you want to use (I used COM7). Make sure "Secure Connection" is not checked. Then click Finish.


Configuring the Gps in WM5
- Go to Start > Settings > Connections
- Do you have the GPS icon? If not see the post here to get it.
- I ignored the Programs tab (though I understand some Dell devices need this setup)
- On the Hardware tab select the COM port you chose in step 9 above (I used COM7) and the speed for your device (I used 57600 for the BT-338)
- On the Access tab select "Manage GPS automatically"
- Click OK

HTH
Ian
There is a current series of 13 WebCasts on Mobile development by Maarten Struys over at http://msdn.microsoft.com/mobility/webcast/ that are well worth checking out if you are working with WM5. In part 6 he shows a way of creating a splash screen on a separate thread, which is pretty neat. I have summarised the steps here, since I have not seen them on the web before, but I urge you to view the webcasts for more detail on this and many more topics.
Main Form
Create the following variables for your main form (you need to add System.Threading to your namespaces):
private Thread splashScreenThread;
private AutoResetEvent appInitialized;
In constructor for your main form add the following:
appInitialized =
new AutoResetEvent(false);
splashScreenThread = new Thread(SplashScreenThread);
splashScreenThread.Priority = ThreadPriority.AboveNormal;
splashScreenThread.Start();
Now create the SplashScreenThread function which actually displays your splash screen (called Splash in the code below). Note that the constructor has been modified to take two parameters (we'll see how to do this later on)
private void SplashScreenThread()
{
Splash splash = new Splash(appInitialized,5);
splash.ShowDialog();
}
After you have done any initialisation work in the Main form (perhaps in Form_load) you can tell the splash screen you are ready and then wait for it to finish with code like the following:
appInitialized.Set();
Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
splashScreenThread.Join();
Splash Screen
OK - over in the Splash form create the following variables:
private
AutoResetEvent mainAppInitialized;
private int minDisplayTime;
and change the constructor to takes those parameters:
public Splash(AutoResetEvent appInitialized,int minimumDisplayTime)
{
InitializeComponent();
mainAppInitialized = appInitialized;
minDisplayTime = minimumDisplayTime;
displayTimer = new System.Windows.Forms.Timer();
displayTimer.Interval = minimumDisplayTime * 1000;
displayTimer.Tick += new EventHandler(displayTimer_Tick);
displayTimer.Enabled = true;
}
You might want to do other work in the splash screen (as Maartyn does in the webcast) but here I am just trying to show the essential steps.
Finally add the tick event handler:
void
displayTimer_Tick(object sender, EventArgs e)
{
displayTimer.Enabled = false;
displayTimer.Tick += new EventHandler(displayTimer_Tick);
displayTimer.Dispose();
mainAppInitialized.WaitOne();
this.Close();
}
Your done. All that is needed now is to add a pretty graphic to the splash screen.
HTH
Ian
Found during a recent expedition:

Comments are disabled for this blog - but please feel free to comment via the contact page
Couple of nasty bugs from the Microsoft.WindowsMobile.Telephony namespace that you need to be aware of if your are using this api. I post them here just to try and help raise the profile of them, since they pretty much break the api if you are not aware of them!
HTH
Ian
Comments are disabled for this blog - but please feel free to comment via the contact page
Windows Mobile 5 has some great new api's. One of the most exciting ones is the ability to query a gps device to get location information. This depends on the gps being configured on the device using the new gps connection icon in settings. However the icon is missing on some devices (e.g. the Orange SPV M5000 and the QTEK 8100 of the devices we have tested). This is a strange omission, but can easily be fixed with a registry edit as follows:
In HKEY_LOCAL_MACHINE\ControlPanel\GPS Settings
- Delete the DWORD marked Hide (if present)
- Delete the DWORD marked Redirect (if present)
- Add a DWORD called Group and give it a value of 2
- Soft reset the device.
The GPS icon should then be available.
HTH
Ian
Comments are disabled for this blog - but please feel free to comment via the contact page
You see it goes like this...we all want all available data available now. We want the world's information at the blink of an eye. The smartphones and the pocket devices won't cut it - too slow, too much hassle. Desktop machines are a joke - too tied to their desktops. No what we need is a new sense, a "Google Sense". So getting the information we want is as natural as seeing or hearing. You will just conceive question, not frame it, and the data will be there. That's the natural progression for the information revolution. No wires, no devices, just a new sense.
Think about it.
Society will change, "Who wants to be a millionaire" will be pointless, Trivial Pursuits even more so. No point saying "did you hear about...", "did you see",... everyone will know everything (well everything that is publicly available or hackable). Everyone will know everything you know (less anything you can keep private, though that will be less and less). You'll know the ending to new movies! You'll know about the person sitting opposite you on the bus without speaking to them. Have a look around you now - what would you know about it all if you had all the Internet streaming into your conscience informing you about it all?
So if we all know everything, where does understanding come in? Is knowledge understanding? Does knowing everything mean new discoveries can be made by combining disparate knowledge bases? I think so.
Now think what would happen if this gift was given to just one person. What could they achieve? Would they go mad with power, start a religion, solve the worlds problems, what?
There's a novel there (and maybe a future)
Just a thought...;)
Unfortunately setting the MasterPageFile in web.config is broken for the designer in the current release of VS 2005 (See http://blogs.ipona.com/davids/archive/2005/10/12/3408.aspx for details). So here's a rough and ready simple hack that you can use to easily switch masters for a deployment.
1. Create multiple default.master files organised in a consistent folder structure. I use Masters > SomeMaster > default.master, Masters > SomeOtherMaster > default.master etc.
2. Create a default.master in the root and create all your pages using this
3. Use a web deployment project and create an MSBuild task to copy the master you want over the one in the root. For an example of similar MSBuild task see this earlier post
During development you can easily copy one default.master over the root one too, so you can preview results in the designer and browser easily.
Pretty obvious, pretty clunky, but at least it is a workable solution until the designer gets fixed.
HTH
Ian
Oh dear... I don't know why I do these things....
Ian
Here's the scenario:
- You use the great new DataSet designer in VS 2005 and have it generate some tableadapters for you.
- You want to inherit from them to add some application (business) logic and some new methods
- Works great, the tableadapters are not sealed and the methods you want are all virtual
- But when you try to bind then using the ObjectDataSource on a web page, the nice new methods you've created are not listed!
This seems to be an issue with the ObjectDataSource UI because if you put them in manually in the HTML source then it works fine. However a neater solution is to use the following attribute on your methods so that they become visible to the ObjectDataSource UI:
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
public int MySelectMethod(){}
There are five enumerations for DataObjectMethodType: Delete, Fill, Select, Insert, Update covering all eventualities
- Go home with the warm feeling of a job well done ;-)
HTH
Ian
Comments are disabled for this blog - but please feel free to comment via the contact page