GoToMyPC - Access Your PC From Anywhere

Well, we are back. After a very long suspension, it is once again time to write about the cool new APIs that Windows 7 provides you for differentiating your application with compelling user experiences. I still owe you two more posts on Windows 7 Taskbar to complete the series, but the Sensor platform is way too cool to leave behind.

Before we dive into the API, I should explain the rational that went into the thinking process of the product team while building the Windows 7 Sensor and Location Platform. (I’ll talk about location in future posts.)

Why Sensors?

Lately we are witnessing the increasing role that sensors play in some very exciting scenarios. For example a mobile device that automatically changes its screen orientation from portrait to landscape based on its relative position to the earth (center of gravitation pull), or computers that automatically control their screen brightness when the lighting conditions change to facilitate a better reading experience. However, I think the best example is the automatic time zone change of a mobile device - when you travel, one of the first things you do once your plane lands is turn on your mobile device, which magically shows you the correct time, even if you crossed a few time zones.

Besides the obvious functional reasons, another good reason to have a “platform” is that it unifies the API and lowers the API and entry costs for developers. In the past, using sensors tended to be a very vertical solution. There was no specific definition of what a sensor was, what its data fields were, or how to access those fields. Lack of standardization made programming for sensors an arduous task. When using a sensor, like a GPS location sensor, you had to choose hardware from a wide range of vendors, each of whom had a specific set of drivers and APIs you had to learn about in order to work with that piece of hardware. If you wanted to change your hardware or vendor, you often had to learn new APIs to access similar information.

In Windows 7, we set out to solve this problem from the ground up (as we usually do). We addressed these problems by providing out-of-the-box support for sensors. The Windows 7 Sensor and Location platform provides a set of standard interfaces that free developers from the need to become familiar with specific vendor devices and, instead, focus on their application logic, treating sensors as just another “standard” input device. By providing these standard interfaces, the Windows 7 Sensor and Location platform offers a win-win-win situation, wherein it’s easier for developers to discover, access, and receive information from sensors, thus creating room for more developers to optimize their applications to environmental changes. In return, this creates a greater demand for sensor hardware and, if you are a hardware provider, you have a standardized way to target one set of APIs to integrate with Windows. And most importantly, end users get to experience applications that take into account the environments they are working in.

The location piece of the puzzle adds an abstraction layer on top of the Sensor platform with the sole purpose of providing an easy way to retrieve data about a geographic location while protecting user privacy.

Sensors Under the Hood

To better understand the Sensor Platform API, I want to take you through a quick overview of the platform architecture, explaining the role of the main components in the platform. The following figure illustrates the main components in the system. Note that this figure is doesn’t outline the entire platform, as it misses the location piece, but it will most certainly do for now.

sensor_Arch1

The first component in the platform is the actual sensor device – shown as number 1. Usually, this is a real physical device that measures physical phenomena such as the amount of light, temperature, humidity, relative gravity force, and so on. However, a sensor can be a logical device (also known as a virtual sensor). A virtual sensor is a software-based sensor that can mimic sensor-type functionality by “impersonating” a sensor and providing data to the platform. Virtual sensors can be used to simulate real sensors to help the development process, as you’ll soon see.

Each sensor requires a driver that facilitates the connection between Windows 7 and the hardware device. This integration is achieved via a user mode device (UMD) sensor driver – shown as number 2.

To make it easier to write a device driver that exposes a sensor to Windows 7, the platform provides a sensor class extension – shown number 3. This is essentially a driver utility library that implements the common code required for sensor drivers. We are not going to talk about hardware or drivers in this post, however we have two excellent videos (Windows 7 Sensor and Location - Developing Drivers Part 1, and Part 2) with Gavin Gear describing in great detailed how to write a sensor driver.

After a sensor is installed and integrated, it becomes discoverable to the application via the sensor API – shown as number 4.

One of the main advantages that the Windows 7 Sensor and Location offers is that it enables multiple (different) applications to receive data from the same sensor at the same time – show as numbers 5 With previous Windows versions, devices usually used virtual COM ports to communicate with the system. One of the problems with virtual COM ports is that they don’t scale and can’t support multiple consumer applications at the same time; therefore, having a platform that supports multi-concurrency is a great advantage.

The last component of platform is the Location and Other Sensors dialog, which is part of the Control Panel. This dialog – show as number 6 enables users to control permission settings and other parameters the sensor provides. The following image is a screen shot of my Sensor and Location Control Panel. As you can see, I currently have two sensors installed – the Sensor Development Kit and the Virtual Light Sensor, and both are enabled.

SensorAndLocationControlPannel

The last topic to cover before we jump into the APIs is to explain how sensors are represented in the platform.

As we’ve seen above, a sensor can be either a physical device or a logical (virtual) sensor. Regardless of the sensor’s type, all sensors share similar properties, as explained in the following list:

Armed with the above information, you are ready to start working with sensors and dive into the API. But to do this, you will have to read the next blog about the sensor and location platform.

Last week Steve Ballmer spoke at the Global Energy Forum in Houston, Texas and discussed the ways information technology is used in the oil and gas sector. Specifically, Steve touched on how the industry is impacting the development of new technologies and how existing technologies are aiding the industry’s innovation. Beyond the Global Energy Forum, the world is abuzz with conversations about how energy, oil and gas companies can create solutions that will reinvigorate the state of the industry. As a recent Microsoft News Center release noted, “Wild swings in supply and demand, volatile prices and shifting worldwide energy policies have made exploration and production more complex than ever.”

We’re pleased that Windows 7 is able to reduce headaches for IT Pros in this industry and enable them to improve productivity, enjoy a faster and more reliable management experience, and reduce costs. Check out customers below for more information:

For more information on Windows 7 for large, medium or small businesses, check out our business site, or read more enterprise company case studies or SMB case studies. We also have a resource dedicated to IT professionals: the Springboard Series on TechNet offers information, tools and guidance for migrating to Windows 7.

Early last month, Windows announced a new music discovery program in partnership with ReverbNation called Playlist 7. This program is exclusively for members of our Facebook, MySpace and Twitter communities.

If you’re already a Fan / Friend / Follower of Windows on Facebook, MySpace or Twitter then you already have access to 7 songs of your choice from 600 participating musicians every week when you visit the Playlist 7 website. If you’re not already a Fan / Friend / Follower of Windows, then you can become one instantly on the network of your choice, direct from the Playlist 7 website.

Once you’ve “connected” to Playlist 7, you will be able to check out this week’s Current Contenders to sample and can download your choice of any 7 songs. Current Contenders change every week (until the program ends of course), so you will want to keep checking Playlist 7 each week for new downloads. The 7 Featured Artist songs are the most downloaded songs from the prior week – they are also free to download for everyone who is connected.

In the first month, we’ve seen a fantastic early response for Playlist 7. Since November 30th, 20,509 Fans, Friends, and Followers of Windows have connected to the Playlist 7 and have downloaded 203,744 songs (which are absolutely free) in just 6 weeks of the program! And we’ve got 5 more weeks to go! Keep checking Playlist 7 each week for a new set of Current Contenders and songs from Featured Artists!

keep looking »
eXTReMe Tracker