Blog

  • Odd Issue With Camera Preview on Surface RT

    When directly integrating video capture in your Windows Store app you can use the MediaCapture class. There are a number of methods which affect the video but not all will be supported on all devices. One of these is SetPreviewMirroring

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.media.capture.mediacapture.setpreviewmirroring.aspx?lc=1033

    This mirrors the preview video so that your image is, well, like a mirror. However I’ve discovered that although the method throws an exception if not supported, it also throws an exception on Surface RT even though it is supported and the video is correctly mirrored. Worse still the GetPreviewMirroring method returns false when the video is currently mirrored 😦

  • Prototyping with Infragistics Indigo

    I recently needed to create a prototype for a Windows Phone application and having recently discovered it I decided to use Indigo Studio to build it. The application is not particularly designed for Windows Phone however it has enough standard UI controls and customisations to make it easy to create phone mockups. They say a picture says a thousand words so why not have a look at a sample I created showing a few screens of an imaginary phone application.

    http://indigo.infragistics.com/prototype/XX47K8P4

    In posting that link I’ve just highlighted one of the great features – you can build a prototype and then share it (either on Infragistics servers or your own) via the web. The Silverlight magic then gives your clients a rich experience to understand the scope and user flow around the application. I intend to revisit this in a series of blog posts to discuss gotchas and tips for creating Windows Phone prototypes. Oh and one of the best features – it’s free!

  • Working with .png Images

    In my previous post I discovered a limitation with using the Share… extension point in the Photos app. The good news is that from within your own app you can open .png files. For this you can use the PhotoChooserTask which has been available since Windows Phone 7. This presents the user with essentially the same UI as the Photos app and you can browse the Screeshots folder and select those .png files. The Completed event returns you a PhotoResult containing the raw stream and the filename which you can use to open the file. Because .png access is available this way it seems an odd decision that it is not supported from the Photos app itself. The moral of the story – provide multiple methods for your user to select files…

  • Photos Extra Share and .png

    On Windows Phone 8 it is possible to register your app with the Share… extension point on the photo viewer. This allows your app to receive an image file and process it whether that is sending it to an online service or manipulating it on the device. I found recently an odd quirk with the feature. I setup the extension following the MSDN documentation. I wanted to test on my captured screenshots on the device so I went into the screenshots folder, selected an image and tapped share. While a range of system extensions were shown my custom app was not. I later discovered that it works in other albums. The reason as it turns out is that all screenshots are captured as .png files and camera images are .jpg and for whatever reason photo extras are not enabled for .png files. I searched online and there was a forum discussion but it is still awaiting a formal confirmation from Microsoft that this is expected behaviour.

    http://social.msdn.microsoft.com/Forums/en-US/wpdevelop/thread/095a3300-111e-46d8-968a-3af1036504b7

  • 32feet.NET for Windows Phone

    With the recent announcement of Windows Embedded Handheld 8 it seems fitting to discuss something related to industrial and line-of-business applications which you can develop now on the Windows Phone platform.

    I’ve released the first drop of 32feet.NET for Windows Phone 8 to our CodePlex site and NuGet. Because the programming model on Windows Phone (based on Windows Runtime StreamSockets) this is a separate package and doesn’t follow the programming model of the main 32feet.NET release. Windows Phone 8 supports Bluetooth programming out-of-the-box it is not straight-forward as it is build around the Windows Runtime Peer networking APIs but is different to the Windows 8 implementation. The aim of the 32feet library for Windows Phone is to simplify common tasks. This initial release adds the following features:-

    • Strongly typed extension methods for ConnectAsync which accept service Guids or numerical port numbers
    • BluetoothDevicePicker which offers an easy way for a user to select a device. Equivalent to the SelectBluetoothDeviceDialog in the core 32feet library.
    • Common Bluetooth service Guids
    • Bluetooth Barcode scanner sample. This sample app connects to a Motorola CS3070 scanner and allows input of Barcodes to the device screen. It should also work with other Bluetooth serial based scanners.

    This is just a first release and we will be continuing to develop the library as well as add further localisation and samples. For example to demonstrate connecting to applications running on the desktop (Sorry not Windows Store apps currently). Your feedback is valuable so please visit the CodePlex project site to provide feedback.

    There is a NuGet package available for the Windows Phone flavour of 32feet.NET to allow you to easily add it to your projects:-

    http://nuget.org/packages/32feet.NET.Phone

  • Persist Bluetooth Addresses on Windows Phone 8

    The Bluetooth API on Windows Phone 8 is based around some customisations to the Proximity APIs which are part of the Windows API introduced with Windows 8. When you “discover” devices you can retrieve a collection of device identifiers for paired devices. The first time you perform a task you will want to use this mechanism to select the appropriate device. However you may want your app to remember a specific device and try to connect again on subsequent attempts. In the old .NET world with 32feet.NET we have a constructor for BluetoothAddress which allows you to supply the address in a variety of string or numeric forms. In the Windows API the Windows.Networking.HostName type is used to represent a host name whether it is for a Bluetooth device or an IP address. Normally the read-only Type property will indicate the type of the host.

    In order to store a Bluetooth address for later use you should save the RawName property which for Bluetooth devices is in the form “(11:22:33:44:55:66)”. The dotted hex notation is fairly common but notice the address is wrapped in brackets. Now to restore this address in a HostName instance you can later use to open a socket you can use:-

    HostName storedHostName = new HostName(storedRawName);

    You’ll notice that this sets the host name and correctly sets the Type property to Bluetooth.

  • iCalendar Files on Windows Phone 8

    iCalendar files are based on the set of data exchange specifications which also includes vCards. You may come across them either in emails or from a website. For example some sites which sell travel tickets allow you to download your itinerary in an iCalendar file. While Windows Phone has always supported vCards for contact information it doesn’t recognise iCal files.

    Since Windows Phone 8 introduced the ability to register for file associations this allowed me to use some old code I wrote back in the days of Pocket Outlook on Windows CE and Windows Mobile. My free iCalendar Import application has just become available in the Store for Windows Phone 8. You can download it from the link below. I’d welcome any feedback. There are some limitations on the supported event types – there is no way to insert recurring appointments into the user’s calendar so this supports single events only.

    http://www.windowsphone.com/s?appid=95287e45-05d7-4a63-aa82-619192cb1713

  • WriteableBitmapEx for Windows Embedded Compact 7

    I have ported René Schulte‘s excellent WriteableBitmapEx project to run on Windows Embedded Compact 7. The original library supports drawing across various XAML user interfaces – Silverlight, Windows Phone, WPF and Windows 8 Apps. Because XAML In The Hand exposes an object model which matches Silverlight there was very little work required to port, it just needed a new Dll project for .NETCF 3.5 and a reference to the XAML In The Hand DLL. This allows a whole range of complex drawing operations to be performed where using Silverlight Paths and Shapes would be inefficient.

    WriteableBitmap for Windows Embedded

    Performance will vary more because the range of hardware platforms available for Windows Embedded Compact varies considerably, both in processing power and screen sizes. I’ve tested the code on FreeScale development boards at up to 1024×768 and on the new Motorola WT41N1 Wearable Computer which has a small 320×240 resistive touch display with encouraging results. Writing XAML user interfaces for embedded devices is incredibly easy once you’ve experienced the Windows Phone and desktop tools. With built in support for touch and dynamic layouts and all the animation and data-binding you would expect it allows you to write fluid user interfaces for specialist devices where a consumer phone or tablet would be impractical. More information on XAML In The Hand is available here

     

  • Connect Visual Studio 2008 to TFS2012 or Team Foundation Service Preview

    Now that there is a new release of Team Foundation Server you may consider upgrading. However if you still work on projects for the .NET Compact Framework you’ll still be using Visual Studio 2008. Luckily there is an update available to allow VS2008 to connect to a TFS2012 server or the new Team Foundation Service Preview (hosted TFS – why not check it out with a free preview account). You’ll need VS2008 Service Pack 1 installed first (but you’ve got that already right!). The download and instructions are available here:-

    http://support.microsoft.com/kb/2673642

  • Windows Marketplace for Mobile 6.x to be Discontinued

    If you publish apps on the old Marketplace for Windows Mobile 6.x you should have received reminders that the service will be discontinued in two weeks. If you have been using our Mobile In The Hand product with a managed code app there are a couple of issues to be aware of. Our libraries contain the following two classes to provide programmatic access to the Marketplace client on Windows Mobile 6.x:-

    • InTheHand.Phone.Tasks.MarketplaceDetailTask
    • InTheHand.Phone.Tasks.MarketplaceLauncher

    If these are called on a device with the Marketplace client installed they will launch the client application however once the service is discontinued no application details will be accessible so this may result in a confusing experience for your users. Consider these classes obsolete as they will no longer be supported and will be removed from the next release.

    https://inthehand.uservoice.com/knowledgebase/articles/72785-windows-marketplace-for-mobile-6-x-to-be-discontin