YOUR FEEDBACK
Three RIA Platforms Compared: Adobe Flex, Google Web Toolkit, and OpenLaszlo
NN wrote: Yeah you are right GWT is poor man's Flex. After using GWT on two...

SYS-CON.TV
TOP MICROSOFT .NET LINKS


Shiny New Tablets
Coming close to the paper near you

Digg This!

The Tablet PC is nothing new. It is an evolutionary step upwards towards the dream of electronic paper. It is a big increment and represents one of the largest movements in that direction that we have seen for some time. For example to use the Tablet PC you don't have to learn a new way of writing, in fact, it even recognizes most of my joined-up writing, which is amazing because most human beings don't seem to be able to do that!

But it is still not new. I remember working with the Pen for Windows SDK in the early 1990s and thinking "hey, wow, this is cool," and then the Newton from Apple and a host of PDA devices came along and they all tried to steal the thunder from paper. Yet in many ways traditional paper still contains some features that the technology has yet to tackle. It doesn't break when I drop it on the floor, it is very tactile, and I can fold it and carry it in my back pocket without worrying about sitting on it. Paper also accepts a wide variety of input devices - pens, markers, pencils, and erasers.

So why use a Tablet PC? The electronic paper presented by a Tablet can do things you can't do with traditional paper. I can store all my notes in one place, I can stretch the page to squeeze new text between existing lines, I can connect it to Microsoft Outlook and e-mail notes, set tasks, and take minutes for meetings. The dream of the paperless office is one step closer, but in order to really make the difference we software developers have to write applications to take advantage of the new features and help add business value to our organisations through the use of the technology.

The new Windows XP Tablet PC Edition 2005 has been released and the Tablet PC Platform SDK 1.7 is now available. You can download the SDK from http://msdn.microsoft.com/TabletPC.

This new version of the platform ships at the same time that Tablet PCs are coming down in price and supporting more features. We are starting to see Tablet PCs with larger screens, Bluetooth support, faster CPUs, and more memory. At the same time, digitizer screens are being fitted to more conventional machines with prices only a couple of hundred dollars from the equivalent laptop.

The new features presented in the SDK for us developers can be broken down into three areas: context, stylus input. and Web support.

Context
The context support provides hints to the TIP (Tablet Input Panel) in order to aid the recognition process. For example, you may wish to tag a TextBox as a phone number field. The recognizer will then use this guidance to improve the accuracy of the recognition. For a phone number it is more likely that a vertical line is the number one than a lower case letter L.

Context can be applied programmatically within the application code or via an additional XML file. The advantage of using the XML file is that you can apply the context for a set of input fields without having to change the code of an existing application.

Adding the code to recognize with context is simple:

// Create a recognizer context from the recognizer
recognizerContext = recognizer.CreateRecognizerContext();

// Setup the RecognizerContext's Text Context (Word List and factoid)
recognizerContext.Factoid = "(!IS_TELEPHONE_FULLTELEPHONENUMBER)";

You'll notice that the Factoid property is a string. Currently there are around 50 constants defined in the SDK. In the COM API these context strings are defined in an enumerated type. Managed code developers currently have no default-type safe mechanism. I would suggest that if you are going to heavily use context strings you define your own enumerated type.

Stylus Input
One of the issues I have encountered in developing applications that utilize Digital Ink is a noticeable degradation of performance that occurs when you trap the stylus (pen) actions in an event handler. Remember that the digitizer has a very high sampling rate. By default some of the events are not even switched on until an event handler is attached. An example is the NewPackets event that fires as the stylus moves across the digitizer.

To solve this problem the Tablet development team have produced the RealTimeStylus (RTS) class. The RTS allows you to programmatically trap the events produced from the stylus. The RealTimeStylus class provides a queue that holds the events generated from the stylus. This queue is filled from a separate thread so as to not impact the UI performance. In order to use the events in the queue you need to create a class that implements IstylusSyncPlugin (see Listing 1).

An object that supports the IStylusPlugin is called a RealTimeEventSink object. By creating your own RealTimeEventSink objects you can customize how the ink gets displayed. You can also use build a gesture recognizer this way. The Framework provides a DynamicRenderer and GestureRecognizer; you can use these to get started.

In the CustomRenderer class the Packets are intercepted from the queue and being used to draw small blue circles on the Graphics object. The RealTimeStylus queue is a fixed size. The fixed size means that if you implement something which is processor intensive you may lose some packet data. With regular sized packets the queue can buffer approximately 10 seconds of packet data.

In order to use the CustomRenderer just defined you need a class that implements the IStylusPlugin interface (see Listing 2).

In this example an instance of a CustomRenderer is added to the RealTimeStylus. The CustomRenderer will draw the blue circles in the GroupBox. I left out the details of the IStylusAsyncPlugin implementation because they are not required for this simple example.

Web Support
The final big addition to the Tablet SDK is the support that has been added to allow inking online. Inking online is achieved through a slight of hand. First a Windows control needs to be created that can accept Ink (see Listing 3) This control can then be embedded in a Web page, using the Object HTML tag.

<OBJECT id="inkComment" height="200" width="400"
classid="WinInkComment.dll#WinInkComment.InkComment" VIEWASTEXT>
</OBJECT>

It is then possible to call methods in the embedded object via JavaScript code on the webpage.

If you plan to provide a substantial amount of Ink support on your Web site I suggest that you create a Web User control that hosts the Ink-enabled Windows control.

To help you further, when a request for a Web page is made from a Tablet PC running Edition 2005, an identifier is placed in the UserAgent string. You can use this identifier to alter the way a Web site appears to a Tablet PC user (see Listing 4).

Write On
The new capabilities of the Tablet PC Edition 2005 and the tools provided in the Platform SDK 1.7 provide us with another small nudge closer to digital paper. Tablet takeup so far has been mostly limited to vertical markets where the advantages can be seen to have immediate business benefit. These vertical markets include health care, real estate, and insurance. The opportunities for Digital Ink within horizontal markets have only been taken up by a few software products, such as Franklin Covey's Tablet Planner and One Note. I believe that in the coming months developer components will become available that utilize the features of the new platform. The new components will lower the entry barriers for development of Tablet applications. I hope to see more Ink-enabled applications in the next year.

About Dr. Neil Roodyn
Dr. Neil is an independent itinerant consultant, trainer, and author. He travels the world working with software companies. Dr. Neil loves Australia, where he spends the summer enjoying the Sydney lifestyle and helping software development teams get more productive. Dr. Neil spends his other summer each year flying between northern Europe and the USA, working with software teams and writing about his experiences. Neil brings his business and technical skills to the companies he works with to ensure he has happy customers. His latest book, eXtreme .NET, introduces eXtreme Programming Techniques to .NET developers. You can find out more from his Web site www.Roodyn.com.

MICROSOFT .NET LATEST STORIES
Peer Networking Series - A Closer Look at PNRP vs. Bonjour/ZeroConf
It seems as though whenever I bring up PNRP and its benefits, I am immediately inundated with a list of questions or comments indicating that Microsoft is re-inventing the wheel and that PNRP has already been implemented before in the form of ZeroConf and, more specifically, Apple's im
Microsoft, Unisys, Yahoo and Vista
Microsoft, which spent $6 billion on aQuantive and was chasing Yahoo for its ads before it came to a dead stop, has been supporting - as in helping write - legislation in New York and Connecticut that would regulate the data that companies like Yahoo and Google collect for targeted adv
AJAX World - Xceed Launches Microsoft Silverlight 2 Control
Xceed launched Xceed Upload for Silverlight, the commercial offering in support of Microsoft's promising new Silverlight technology. The product is available now for purchase or as a fully functional 45-day trial on Xceed's website. Xceed Upload for Silverlight lets developers add uplo
Microsoft To Keynote 4th International Virtualization Conference & Expo
Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec
Microsoft Virtualization Takes Management Cross-Platform
Microsoft is making System Center, its central management scheme, natively manage Linux, Unix and VMware virtual servers. The widgetry has always been a Windows-only affair, but now there are betas available showing off Microsoft's cross-platform prowess, important to Microsoft's place
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING NEWS FROM THE WIRES
Open-E Data Storage Server Solution Empowers Nor-Tech's Robust Voyageur(TM) Storage Server
Open-E, Inc., a leading developer of innovative storage management software, announced today