# Tuesday, June 15, 2004

Do our APIs give the same reaction?

Eric King posted this hilarious picture to his blog showing the .NET Framework Standard Library Annotated Reference as you've probably never seen it before. I wonder if OpenNETCF class libraries get the same reaction from developers... :-)

#    |

Tech-Ed 2004 Amsterdam

I've been invited to help out on the Tablet PC Ask-The-Experts booth at Tech-Ed Europe. This promises to be a pretty cool conference with some great mobility content. I'm definately looking forward to it!

#    |

UK Tablet PC ISV Challenge - Judging Complete

In the last couple of weeks I've been down to Microsoft's UK headquarters in Reading as a member of the judging panel for this interesting Tablet PC competition.

Entrants were given the ability to purchase a subsidised Tablet PC and develop an application which they felt was perfect for the Tablet PC platform. The first week we looked over many entries aimed at a whole range of vertical markets, this was reduced to a shortlist of 10 entrants who came in this week to give a short presentation to the panel and get a chance to explain their projects in more detail and demonstrate some of the Tablet PC specific features.

There can be only one winner of course, they will receive the chance to travel to Microsoft's HQ in Redmond and meet with the Tablet PC team. I can't tell you who that is yet as it will be announced at the Tablet PC event in Heathrow next Tuesday. It was a really interesting experience to see the range of things people are planning to use Tablet applications for.

#    |
# Sunday, June 13, 2004

Vibration and Pocket PC devices

A number of Pocket PC devices support Vibration as an alert method, most (but not all) are Phone Edition devices. The Vibrate class in the OpenNETCF.Notification library is specific to Smartphone devices only.


However the good news is that the Vibrate functionality is implemented as a notification Led so you can control the vibration using the Led class. One of the peculiarities of the NLed API is that the collection of Leds may contain gaps, for example some devices contain a notification Led at position 0 and a vibration device at position 5. There is no way to programmatically determine the index of the vibration device, you can only determine the overall count of devices. Also the vibration device can only be turned on or off so the Blink setting behaves exactly as On would.


On the HTC Himalaya the vibration device is implemented at index 1 and the following code can be used to turn on and off the vibration:-


OpenNETCF.Notification.Led l = new OpenNETCF.Notification.Led();


//turn on vibration


l.SetLedStatus(1, OpenNETCF.Notification.Led.LedState.On);


//turn off vibration


l.SetLedStatus(1, OpenNETCF.Notification.Led.LedState.Off);

#    |
# Saturday, June 12, 2004

Vibration and Pocket PC devices

A number of Pocket PC devices support Vibration as an alert method, most (but not all) are Phone Edition devices. The Vibrate class in the OpenNETCF.Notification library is specific to Smartphone devices only.

However the good news is that the Vibrate functionality is implemented as a notification Led so you can control the vibration using the Led class. One of the peculiarities of the NLed API is that the collection of Leds may contain gaps, for example some devices contain a notification Led at position 0 and a vibration device at position 5. There is no way to programmatically determine the index of the vibration device, you can only determine the overall count of devices. Also the vibration device can only be turned on or off so the Blink setting behaves exactly as On would.

On the HTC Himalaya the vibration device is implemented at index 1 and the following code can be used to turn on and off the vibration:-

OpenNETCF.Notification.Led l = new OpenNETCF.Notification.Led();

//turn on vibration

l.SetLedStatus(1, OpenNETCF.Notification.Led.LedState.On);

//turn off vibration

l.SetLedStatus(1, OpenNETCF.Notification.Led.LedState.Off);

 

I'll be updating the documentation to make this clearer as currently the Vibrate class is incorrectly listed as supported on Smartphone and Pocket PC Phone Edition.

#    |
# Thursday, June 10, 2004

Smart Device Programming chat starts soon!

I intended to post this slightly more in advance but have been travelling around all this week, please excuse me :-)

Chat Date: June 10th
10:00am - 11:00am Pacific Time
1:00pm - 2:00pm P.M. Eastern time
17:00 - 18:00 GMT/BST

Description: You know them from the newsgroups! You love them for their
immense knowledge! Please join these amazing Microsoft MVPs in this live
chat regarding the .NET Compact Framework and the Smart Device Programming
features of VS.NET. The .NET Compact Framework is a subset of the .NET
Framework designed to allow .NET developer to target smart devices. The
Smart Device Programming features of VS.NET allow embedded developers to
target devices running the Compact Framework.

To join this chat, please visit:
http://communities2.microsoft.com/home/chatroom.aspx?siteid=34000070

#    |
# Monday, May 24, 2004

Visual Studio 2005 Team System and new source control system

Steve Ballmer officially unveiled "Visual Studio 2005 Team System" which is a collection of tools around Visual Studio, previously code-named Burton. There's more juicy details on Korby's weblog.

Part of this is a new source control system code-named "Hatteras" which is based on SQL Server. This is used both to track work items and source code checkins, there is even an ASP.NET interface into the system, and of course full integration into Visual Studio itself.

Looking through the juicy documentation on the recently opened Team System website, one of the clear messages you get is that the system is designed for all the different roles within a team - there are tools for architecture, development, project management and testing but they all integrate together.

While none of this is specific to Smart Device development this looks like an interesting suite of technologies for any software team.

#    |
# Saturday, May 22, 2004

Want to know more about OpenNETCF.Security.Cryptography?

As Sam points out, the OpenNETCF.Security.Cryptography library was donated to the OpenNETCF codebase by fellow MVP Casey Chesnut. So a good source of information about how the library is built is Casey's original article on the subject.

The library is designed in such a way that it follows the object model of the System.Security.Cryptography namespace in the full framework. A background on the Cryptographic services in .NET can be found here in the MSDN library.

 

#    |
# Friday, May 21, 2004

Friday Fun: Automating Windows Media Player from .NETCF

Windows Media Player for Pocket PC (and Smartphone) doesn't have a true object model like it's desktop cousin, so the ability to use it from your own code is limited. However there is an undocumented method of sending commands to Windows Media Player via a specific series of Windows Messages. These are actually hidden away in the Registry under the curiously named section "Pendant Bus".

Therefore I put together a simple dll which creates an instance of Media Player if one is not already running, and sends messages to it, to allow you to play, pause, move back and forward through the playlist or adjust the volume. The code requires the Smart Device Framework which is used to P/Invoke a couple of Windows methods e.g. SendMessage. A typical method looks like:-

/// <summary>

/// Skips to the next track in the playlist. /// </summary> public void NextTrack() { Win32Window.SendMessage(hwnd, 32972, IntPtr.Zero, 0);

}

There are some limitations in the code I've posted here - it doesn't start the player with a specific file queued up (this would require a very simple overload to the constructor).

There are currently no events and it is not possible to get information back from the player such as track name, elapsed time etc. I'm still investigating whether such information is output in any way which can be captured. This code should work with all Windows Mobile 2003 devices (inc Smartphone) and possibly earlier Pocket PCs but these have not been tested yet.

Download the full code project with Pocket PC sample application here.

#    |
# Wednesday, May 19, 2004

Smart Device Framework v1.1 Release Notes

I thought it would be a good idea to compile a set of release notes for v1.1! You can view the resulting document here:-

http://www.opennetcf.org/PermaLink.aspx?guid=a8b2c046-b9fd-4b0b-bd21-f0d03f6bec55

The document lists the new items in this release. I haven't compiled the more subtle changes to existing classes (new methods, bug fixes etc). These are available by looking through the ChangeLogs for the individual assemblies via the installed Source Code shipped with the package or via the online SourceBrowse interface.

Importantly also I've documented a number of known issues with this release. For many there is a workaround which is described, for other issues you can be assured they have been logged and will receive attention for the next release. If you encounter an issue which is not listed here please submit it either to the Forums or via our Submissions email address.

#    |
# Friday, May 14, 2004

.NET Compact Framework drum machine...

Spotted this on Seth Demsey's blog:-

The article by Ianier Munoz shows how a desktop drum-machine sample was converted to the .NET Compact Framework. Calls to managed Direct Sound were replaced with P/Invokes to the WaveOut APIs. Check it out!

http://www.microsoft.com/belux/nl/msdn/community/columns/munoz/cfrhythm.mspx

#    |
# Wednesday, May 12, 2004

Upcoming .NET Compact Framework Chat: 13th May 2004

Coming up tomorrow, the latest MSDN web chat with the .NETCF and Visual Studio for Devices team. Below are the details from MSDN:-

 

Smart Device Programming with Visual Studio .NET 2003
So what's that 'Smart Device Application' project type is all about? Please join the members of the .NET Compact Framework and Visual Studio product groups in this live chat regarding the .NET Compact Framework and the Smart Device Programming features of VS.NET. Please come prepared to ask the tough questions!

May 13, 2004
10:00 - 11:00 A.M. Pacific time
1:00 - 2:00 P.M. Eastern time
17:00 - 18:00 GMT


Event Reminders


OutlookAdd to Outlook Calendar
FriendTell a Friend
#    |
# Monday, May 10, 2004

Three ways to deploy the OpenNETCF.org Smart Device Framework

1. The simplest method is to deploy the entire Smart Device Framework using the CAB files provided. When you deploy a project including a reference to an OpenNETCF dll this will occur automatically. The device gets the whole framework installed into the Global Assembly Cache (GAC) and an entry in the remove programs applet in control panel.

2. An alternative is to deploy only those dlls which you use in your project within your own custom CAB file. Be aware that there are dependencies between the libraries so if you use OpenNETCF.Windows.Forms, then you need OpenNETCF.Drawing.dll and OpenNETCF.dll also. I think some kind of dependency diagram would be useful to illustrate all the dlls in the SDF, I'll follow up with this in a later thread.

3. The third method (which is the most flexible and more complex) is to cherry-pick the classes you use from our source code and either build your own dll, or place it directly in your exe. If you are a VB.NET developer you'll need to use a dll project since most of our code is in C#. As with method 2 you need to take care to include any dependencies of the class(es) you use, if they are not present in your project (or referenced) then you'll get build errors. We don't have a definitive reference of dependencies for each class, however I'm sure it's something we can eventually phase into our documentation. In many cases related classes are contained in the sale code file - e.g. Registry and RegistryKey.

#    |
# Saturday, May 08, 2004

P/Invoke Add-in for Visual Studio

The site at www.pinvoke.net is a rapidly expanding Wiki solely devoted to P/Invoke definitions for .NET. This now includes Compact Framework P/Invokes for coredll, aygshell, rapi etc.

To accompany this resource there is a Visual Studio plugin which gives you a right click option while editing code to insert a ready-made P/Invoke definition. If the one you want isn't available then you are encouraged to add the definition to the library.

You can download the add-in from GotDotNet:-

http://www.gotdotnet.com/Community/UserSamples/Download.aspx?SampleGuid=75122F62-5459-4364-B9BA-7B5E6A4754FE

The downside to the www.pinvoke.net site is that it only displays correctly in Internet Explorer.

For the Compact Framework specific wiki check out http://wiki.opennetcf.org

 

#    |
# Friday, April 30, 2004

P/Invoke Wiki Update

Chris has setup a Wiki for OpenNETCF, I've added a few topics to sample how P/Invokes may be presented. There will be a lot more work to do to get the template just right but I wanted to ensure the following was included for each entry by default:-

  • C# definition
  • VB definition
  • Equivalent managed functionality. This will point to the .NETCF class you can use to avoid P/Invoking in the first place or the OpenNETCF class which implements the P/Invoke.
  • Link to full description in SDK. Microsoft have placed online in the MSDN library the CE.NET 4.2, Pocket PC and Smartphone SDKs which describe the functions and their arguments and usage.

Because of the nature of a Wiki there is an opportunity to easy tag additional information on, for example Samples or articles which directly apply to the function.

#    |

Understanding AcceptChanges and DataAdapter.Update

Bill Ryan from KnowDotNet and Devbuzz has posted an article clearly describing the issues around DataSets which arise commonly on the newsgroups and discussion forums.

http://msmvps.com/williamryan/posts/5679.aspx

These include "Why does calling AcceptChanges followed by DataAdaptor.Update do nothing to the database" and "why doesn't calling Remove on a row doesn't remove the row from the database".

 

#    |

Small but useful update in MSN Messenger 6.2

Recently released with little fanfare is a minor update to MSN Messenger. One of the first changes I noticed which I find useful is if you sort your contacts by Online/Offline status there are now three states.

  • Green - Online
  • Amber - Available in on a mobile device
  • Red - Offline

It makes it easier to distinguish between those who are completely offline and those who can be "pinged" on a mobile device.

#    |
# Thursday, April 29, 2004

Mobile phones replace cars as youth status symbol

This article on the Economist provides the opinion of how mobile phone handsets are replacing souped up cars as the young poser's object of choice.

http://www.economist.com/opinion/displayStory.cfm?story_id=2628969

It cites car style poster adverts for the XDAII as proof, however I think this is a little of a red herring as the XDAII is definately not aimed at the "yoof" market.

It's a well known fact that young people account for a large number of "lifestyle" phones which are sold, and they tend to change handsets regularly to keep up with peer pressure and have the latest features. Does this mean that young people will spend their time running around town with loud annoying ringtones rather than driving round and round in old Vauxhall Nova's with a spoiler gaffer-taped on? We'll I'm prepared to wait and see... :-)

#    |

Strongly-typed DataSets

Chris Craft has written how to get around the lack of support for Strongly-typed DataSet's in the IDE for Smart Device projects.

http://www.cjcraft.com/Blog/PermaLink.aspx?guid=23fc2044-c854-4358-a0b8-8460f2c56d49

It requires some tweaking of code but is an interesting proposal. Chris plans a full article on the topic, to be released as and when he has time to complete it.

#    |