Tag Archives: Windows Phone

Application Insight for Windows Store and Windows Phone apps

21 Nov

In the launch keynote of Visual Studio 2013, Brian Harry announced and demoed a new service called Application Insights.

The service is available through Visual Studio Online and “collects, processes and presents a wide variety of telemetry including performance, usage, availability, exception, crash, environment, log and developer-supplied data from all components of a modern application – including clients (devices and browser), servers, databases and services.”

With Application Insights it is possible to gain full insight into your Windows Store and Windows Phone applications; how does the user actually use your app, which features are used the most or least, are there any performance issues and so on. All of this will be presented nicely in a dashboard that can easily be customized to your exact needs directly in Visual Studio Online.

Currently the service is available as limited preview and you can sign up from Visual Studio Online:
https://YOURALIAS.visualstudio.com/_appanalytics/_analyticssignup

Bluefragments have been part of the TAP program since early this year and have followed Tofino become what it is today (truly amazing work by some passionate guys!). Looking forward to integrate Application Insights into our Windows Phone and Windows Store apps.

// thomas

Roskilde Festival for Windows Phone

19 Jun

R

A few weeks back a handful of awesome developers, designers and volunteers met to build this year’s Roskilde Festival for Windows Phone. Today we pushed the big button and published the app with the 2013 program and a bunch of great features. We build the app in just 72 hours and the result is amazing … well, if you don’t believe, go ahead and check it out yourself! :)

You can download the app from the Windows Phone store here:
http://www.windowsphone.com/en-us/store/app/roskilde-festival/eec38083-5f16-4f8c-97eb-f8cfabbca937

Give it some love, send some warm thoughts to the developers, designers and volunteers – and see you at Roskilde in a few weeks!

// thomas

The parameter is incorrect

17 Dec

For the last couple of months we have been working on some different Windows Phone projects. Yesterday we ran into an exception in one of our projects. Sometimes when we navigated into a specific page we got an argument exception “The parameter is incorrect”. The exception was inconsistent but we got it more often when debugging compared to when we ran our project in release mode.

2012-12-17_013042

First step was of course to enable as much debugging info as possible which resulted in this StackTrace:

at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Add(UIElement value)
at System.Windows.Controls.ItemsControl.AddVisualChild(Int32 index, DependencyObject container, Boolean needPrepareContainer)
at System.Windows.Controls.ItemsControl.AddContainers()
at System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at Microsoft.Phone.Controls.Pivot.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)

The page was actually pretty simple – a Pivot control with 4 items each containing a usercontrol. So with the StackTrace in mind we looked for some dynamically sized controls within our usercontrols . First of all we tried to change the Pivot control with a Panorama control – still got the exception. So we had to go through our code and line by line we removed content – still got the exception. In the end we had removed all the content inside our usercontrols and the page was stripped down to contain only the most necessary properties. Still got the exception.

In the end I stumbled upon the naming of our usercontrols – not in the page but the x:name within the usercontrol itself. Some of the usercontrols had been giving names that was used as part of some animation. What caught my eye was that two of the usercontrols got the same x:name. I tried to change one of the names and boom! Problem solved.

So to take this little issue to the test I created a small sample demonstrating the issue. The sample automatically navigates from one page to another and back until the exception is through (takes about 2-5 minutes).

The issue is on both Windows Phone SDK 7.1 and 8.0.

// thomas

Resource Dictionary for Windows Phone

6 Nov

One of the missing templates in the Windows Phone SDK is Resource Dictionaries. If you work with styles and resource dictionaries, the missing template is a big thing.

Worry no more! I have created the template you need!

You can get them ItemTemplate from my SkyDrive and install it in your ItemTemplate folder, typically located here:
C:\Users\[USERNAME]\Documents\Visual Studio 2012\Templates\ItemTemplates\Visual C#\Windows Phone\1033

// thomas

How happy are you with your mobile OS?

21 Jul

A few weeks ago I wrote a post about my experience with iPhone 4. I was not very satisfied with the device.

From a survey of 4000+ mobile users, 57 percent of Windows Phone 7 users are “very satisfied” with the devices. That compares to 50 percent who are “very satisfied” with their Android device. Seventy percent of iOS users report being “very satisfied”.

Guess I’m alone in the World…

Read the full article at GeekWire.

by xamlgeek

UriMapping for WP7

15 Dec

UriMapping for Silverlight is pretty straight forward and if you use the Silverlight Navigation template you get it all from the template. WP7 contains many of the same features – it’s just not that obvious.

By default a WP7 app navigate using a PhoneApplicationFrame. PhoneApplicationFrame inherits from Frame – the control used in Silverlight. The PhoneApplicationFrame control is exposed as a property named RootFrame in App.xaml.cs.

To enable UriMapping in WP7 from the code you need to follow a few simple steps:

  1. Create a new method (in App.xaml.cs) that will set the UriMappings you need. In the method you need to make a new instance of UriMapper and for each mapping you wish to create you need to instantiate a new UriMapping specifying the Uri and MappedUri.
  2. Bind the mappings with the UriMapper instance and set RootFrame.UriMapper to the UriMapper instance.
  3. Call the method right after the RootFrame have been instantiated – typically in InitializePhoneApplication.
  4. Modify the existing start page in WMAppManifest.xml to make it fit your mappings.

In the sample below I have added two mappings; a default mapping and a mapping for a detailsview.

2010-12-15_152217

To use your mappings simply call your pages using a relative Uri:

2010-12-15_153430

You can download a demo here.

by xamlgeek
@thomasmartinsen

Follow

Get every new post delivered to your Inbox.

Join 1,412 other followers