SP1 Beta for the .NET Compact Framework V2.0

SP1 Beta for the .NET Compact Framework V2.0

I guess this is pretty old news already, but since this is an area of interest to me I thought that I should at least add to the clutter on the Internet by blogging the fact that a Beta for SP1 for the .NET Compact Framework has been announced and that more information on the added functionality and bug fixes is available on the team’s blog

SQL goes wild everywhere

SQL goes wild everywhere

Since the release of SQL Server 2005 late last year the mobile devices community have been discussing the usage of the SQL Mobile product for application development.  One of the main discussion points has been the usage of SQL Mobile on platforms other than Windows Mobile.  Now you might say, “not support”, but in actual fact you would be partially wrong.  Not only was SQL Mobile designed to work on the WinXP platform, it is actually supported on WinXP Tablet edition.  Intuitively this makes some sense since a Tablet PC can be thought of (in particular when you consider the UMPC devices) as a large PDA and as such it would be convenient to have the same programming model for both devices. 


So, why has this topic received so much attention, well despite the support for running SQL Mobile on Tablet PCs the licensing states that it cannot be run on the standard WinXP platform.  This means that if one of your clients is using a laptop instead of a Tablet PC then they will not be able to run an application based on SQL Mobile.  When you look at it in this light, the decision to support one, but not the other seems quite silly.


Anyhow, lets cut to the chase – Late last week it was announced that a “new” (in fact rebadged/relicensed would be more appropriate) product line would be added called SQL Server Everywhere Edition.  This was followed up with a useful blog entry by Steve Lasker regarding the details of what this new product line would entail. Basically the up shot will be that you can build mobile applications that target SQL Mobile that will run on Windows Mobile and WinXP, allowing you to easily target PDAs, UMPC, Tablet PCs, Laptops and even Desktop PCs.  Note the limitation (of course) around using SQL/e as the db for your web app!

Presenting Skills 101

Presenting Skills 101

I have lost count of the number of presentations that I have literally fallen asleep in.  Mainly it has nothing to do with the content, since I wouldn’t be there if I wasn’t a little interested in the topic.  99% of the time it has to do with the presenter and their usage of powerpoint.  Ok, so I’m not going to come out and say what you should or shouldn’t do because I don’t actually believe there is one “best way” to present.  Everyone has their own style.  This said, I think some general pointers are always useful so I would like to point people to an article I read today on the do’s and don’ts of using presenting with powerpoint.


Would be interested to here comments from others as to what they thought about this article.


 

Using PhoneCellBroadcast in WM5 for cheap location aware applications

Using PhoneCellBroadcast in WM5 for cheap location aware applications

A couple of weeks ago a fellow MVP, Mitch Denny, asked me a question about the Notification Broker in Windows Mobile 5.  For anyone not familiar with the Notification Broker it is a mechanism where you can not only query system information about the device, but you can also register for notification when a system property changes.  Anyhow, Mitch’s question was regarding the PhoneCellBroadcast property and the fact that it didn’t seem to be returning any data. 


Despite talking over Messenger I did my best job to look puzzled having never really played around with that particular property. Mitch proceeded to explain that it was supposed to access broadcast messages from the current cell the mobile was connected to.  Interestingly enough, Australia is one of the few places in the world where the networks appear to broadcast useful information.  To access this information you firstly have to do the following (the steps here apply to Windows Mobile 5 and have been tested on both the K-Jam and JasJar – let me know if it does/doesn’t work on other devices):



Start -> Settings
Select Personal tab -> Phone
Select More tab -> Tick the Broadcast Channels checkbox and hit Settings button
Tick the Receive channel list checkbox
Select English from language dropdown
Hit New… button
Enter Cell (or any other description) into Name textbox and 50 (this varies in different countries but should be correct for Australian networks) for the Channel number
Hit Ok
Make sure the new entry in the Select item to receive: list is checked
Hit Ok
Hit Ok (again, which should take you back to the main settings page)
Wait 10-20 secs and you should receive a notification bubble with the name of the Cell (eg Subiaco) in it.


Ok, so now that we can see the cell broadcast, what can we do with it.  Well firstly, the usage is going to be somewhat limited because although in some cases the cell name is the suburb, in others it is a cryptic abbreviation (eg EstVicPrk for East Victoria Park) or simply a placeholder (eg New Coverage which we got somewhere around North Fremantle).  This said, I’m sure that someone will come up with a use for it so the important thing is that we can extract the contents of this message.


For those familiar with the Notification Broker you will be aware that we can extract information about the current system state using the following lines of code:



Dim x as new Microsoft.WindowsMobile.Status.SystemState(SystemProperty.PhoneCellBroadcast)
MsgBox(x.CurrentValue())


Alternatively, if we want to be notified every time this property changes we can attach an event handler to the Changed event of the SystemState object.  Unfortunately there is a little documented issue with using either of these techniques.  Unless the PhoneCellBroadcast property has a value you will either experience a NullReferenceException or the CurrentValue method will return nothing.


To get this property to function correctly we need to tweak a registry setting which was kindly given to me by one of the mobility guys, Paul Kormann, at Microsoft. By default if you look at the key HKEY_LOCAL_MACHINESoftwareMicrosoftInboxSvcSMS you will see that there is an entry TreatImmediateModeCBAsClass0SMS which has a value of 1.  As the entry implies a value of 1 (ie true I guess) implies that the system should Treat Immediate Mode Cell Broadcasts (ie the network messages we were receiving earlier) as Class 0 SMS.  As I found out from my quick read of the SMS FAQ a Class 0 SMS is designed to be displayed then discarded (versus a Class 1 (ie normal) SMS which is stored).  The net result is that having this value set gives us the notification bubble we saw from the steps above.  Changing the value of this entry (using either a remote registry editor or a registry editor for the device) to 0 should mean that we can access these messages using the notification broker. 


Ok, so I was happy with this and proceeded to change the registry value.  Unfortunately it didn’t immediately work for two reasons.  Firstly in my playing I had disabled the Broadcast channels (the first checkbox in the above steps).  Secondly I hadn’t reset my device.  So the steps to get this to work are:



Complete steps above to enable Broadcast channels
Change Registry value for TreatImmediateModeCBAsClass0SMS
Reset device


Now for the bad news.  I was pleasantly surprised when this worked on my K-Jam so I was quick to pass on the news to Mitch.  Unfortunately try as he might he couldn’t get the same instructions to work on his JasJar.  John also tried this on the SoftTeq JasJar with the same result.


While we were experimenting we did find a useful area of the Registry. HKEY_LOCAL_MACHINESystemState contains a number of keys relating to the current state of the system.  Of particlar interest to what we were doing was the Phone key.  On my K-Jam, after applying the steps above, there was an entry for Cell Broadcast which contained the most recent cell broadcast.  However on the JasJar this entry never seemed to exist.  Interestingly enough when Mitch manually populated this entry the value was accessible in code (as if it has been correctly received via the notification broker).


I hope this is useful to anyone interested in delievering a cheap location aware application.  If anyone can get this to work with the JasJar please let us know.

Enterprise Development using Patterns and Practices

Enterprise Development using Patterns and Practices

Last night, John presented an overview of the Enterprise Library to the Perth .NET Community of Practice.  It was clear that there were mixed experiences within the audience ranging from those that were working with v2 of the library (1 or 2), those working, in anger, with v1 of the library (half a dozen or so) and those that either won’t admit to it or weren’t using it at all.  Having been involved with a large scale application that didn’t use either the application blocks or the Enterprise Library I can only commiserate with those in the same boat – word of advise… spend the time and money to incorporate the Library into your application.  This doesn’t need to be done all at once, you can bring it in piece by piece, but in the long run it should save you time and ensure your product is more reliable.


Ok, so this said, there are some other things that you should really check out, particularly if you are starting a new application and want some guidance on how to build a consistent user experience.


Composite UI Application Block (here)


Mobile Baseline Architecture Toolkit (here)


Also, touch base with John’s blog as he looks at the various application blocks in the Enterprise Library itself. (For those that missed the presentation last night, the slides should be available on the user group site by the end of the week).