Mobile Zone is brought to you in partnership with:

I am developing Windows Store and Windows Phone apps, using all kind of Microsoft technologies to provide unique user experiences. I am also using Xamarin for Android/iOS and Microsoft Azure for all cloud things. I am sharing my experiences with others to help and spread knowledge. Marco is a DZone MVB and is not an employee of DZone and has posted 40 posts at DZone. You can read more from them at their website. View Full User Profile

Use Telerik RadControls for WP? Then use RadDiagnostics to enable users to find bugs!

08.20.2013
| 1399 views |
  • submit to reddit

I know this title is a little provocative and that is my intention. Of course, I will tell you why.

I am participating in several betas for Windows Phone apps. I know some of the developers from Twitter, and had several conversations about bug finding and solving methods. In the end, we as developers all have one goal: a buttery smooth running app without any bugs.

Some of the betas I use are also using Telerik RadControls. They enable us developers to easily create awesome apps without writing the controls from the ground up. On top of that, we are able to customize them for our needs with a bit of XAML manipulation.

One of these controls is RadDiagnostics. RadDiagnostics catches all unhandled exceptions from your application. And believe me, there will be a ton of them even if you've handled a lot of them already.

I didn't believe that, either. But then I ran the beta of my TweeCoMinder app for Windows Phone. I tested the app a lot before publishing my beta, including several scenarios like no network connection available, low battery, and so on. At this time, I stumbled over the RadDiagnostics Control in the documentation.

I immediately saw the advantages of using this control:

  • Advanced error logging, including a bunch of great information like OS Version, device, network type, and more
  • The app won't crash even on unhandled exceptions.
  • The user feels more integrated in the development process.
  • Users tend to use the app in other ways than we developers think, and we can't even get close to catching all of those usage scenarios while testing alone.
  • There are a lot of users who are really searching for bugs, which is both a good and a bad thing.

Let's look into the last point a bit deeper so we can get the most from it. If users find bugs, they will get either annoyed and stop using our apps or they will talk about it. Let's make them talk about the problems to us, the developers! Like I mentioned above, the RadDiagnostics control makes this very easy for the user.

A message box shows up where the user is asked to send us the report, which is done via email. This has two additional advantages: First, we are able to collect all kinds of errors. An even bigger advantage: We are able to respond directly to the user since we have their email address. I learned a lot during the first beta version of TweeCoMinder, about how users use my app and about the coding part, and I was able to continuously improve my app.

Some of you might argue that you don't want the user to see your code. Really, that is stupid. An average user doesn't even know what all of those lines in the exception mean. Only developers are able to understand what is going on. Where is the problem? That they see you have an exception at point X? Chances are very high that they had the same exception at another point and needed to iron out.

Personally, I don't have a problem with the fact that the exception is readable for some beta testers and users. I've had the experience that users love to give feedback if you make it very easy for them. RadDiagnostics is a very easy way since it only needs three taps (OK, choose mail account, and send button).

As this is a dev post, here is how easy it is to integrate it into your app:

  • Declare RadDiagnostics in the public partial class App: Application
    public RadDiagnostics diagnostics;
  • Initiate Telerik ApplicationUsageHelper in private void Application_Launching(object sender, LaunchingEventArgs e)
ApplicationUsageHelper.Init("0.9.5");
  • Call RadDiagnostic in the App() constructor:
diagnostics = new RadDiagnostics();
 {
diagnostics.EmailTo = "yourmail@outlook.com";
diagnostics.EmailSubject = "Here is your email subject";
diagnostics.HandleUnhandledException = true;
diagnostics.Init();
 }

That's all you need to get it working: a few line of code that will give you lots of input to improve your app, and will result in this message:

ReadDiagnosticsMSG

Once again, if you use RadControls for Windows Phone, then use RadDiagnostics to let users help you find bugs. You won't get better or more helpful feedback than this!

You can find the complete documentation of RadDiagnostics here: http://www.telerik.com/help/windows-phone/diagnostics-gettingstarted.html

Another great article that helps you to deeply understand how RadDiagnostics works is over at Kunal Chowdhury's blog.

Feel free to discuss your insights below in the comments. Until then, happy coding!

Published at DZone with permission of Marco Siccardi, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)