Monthly Archives: December 2010

Pro Tip: WP7 Radio Speaker Mode

Much to my delight, I recently learnt that you can use any unshielded headphones as the antenna for phone radios. (Up until then, I had always thought you needed to use the provided headphones, believing they were coated in a magical radio fairy dust…)

This is great, as it means I can use my favored Sony clip-on headphones, instead of the HTC in-ear ones that came with. It’s probably just me and my gargantuan ears, but in ear headphones don’t stay in my ear for terribly long…

But what’s extra cool with WP7 is that if you’ve got your headphones plugged in and you want to share, simply tap and hold to bring up a menu, which includes “radio mode: speaker”. This will play the radio music through the phone speaker, so you can share the good tunes and good times :)

Still amazed that headphone cords can be used as antennae, to be quite honest…

Provisioning Files To A Feature’s Root Folder In Sharepoint 2010

I have been doing some work recently in InfoPath, and as part of investigating deployment of a custom InfoPath form to a Sharepoint installation, it was decided that we would use the not-so-well-documented XsnFeatureReceiver class in order to deploy the form to a site. However, there is a catch to using it – the .xsn must be placed in the root folder of the feature (ie 14/TEMPLATE/FEATURES/MyCustomFeature/MyForm.xsn).

I spent quite a while trying to configure a Module element to provision a file directly to the feature root folder, but Visual Studio 2010 doesn’t allow you to set a blank foldername the module, which means that using a Module, you’ll be stuck provisioning your files to a subfolder on your feature.

It turns out the solution to this (and the right way to include files with your features that you don’t necessarily want to push to Sharepoint/content database) is using the Empty Element item.

Create an empty element and a feature as normal, and add whatever files you want to include to your EmptyElement item:

Then, for each of the files, open the properties window and make sure the Deployment Type is set to ElementFile.

Finally, we’ll set the Path for the deployment location to nothing – unlike a module, an elementfile supports a blank path (which will then deploy the file to the feature root folder, where we want it)

This should now deploy your files to the feature root folder – you can test it out by deploying the solution and examining your physical server’s Sharepoint Root to confirm everything worked as expected.