Posts Tagged ‘Windows Phone’

Introducing Runtime Intelligence Portal 2.0

Tuesday, May 3rd, 2011 by Brandon Siegel

After many months of polishing, the next version of PreEmptive’s Runtime Intelligence portal was rolled out for Runtime Intelligence for Windows Phone 7 users late Sunday night. In the coming weeks, the new portal infrastructure will be released for our commercial Runtime Intelligence customers as well. The underlying infrastructure has been rebuilt from the ground up to provide better performance, reliability, and security. On the surface however, the functionality and look & feel of the portal remain mostly the same. Notable changes include:

  • Portal performance is improved. Additionally, load times should not be affected by factors such as the range of data being examined.
  • The metrics surfaced on each dashboard are more useful, consistent, and intuitive.
  • Some calculations were made more accurate (for example, average session duration is now calculated across only completed sessions).
  • Better and more compatible dashboard widgets.
  • SSL encryption is now mandatory for sensitive operations such as login, and optionally available across the entire site (just use https:// instead of http://).
  • Expanded browser compatibility.
  • Many visual and usability improvements to refine the user experience.

We’ve spent a lot of time refining the portal, and we think that we’ve come up with something that works well, looks good, and addresses many of the concerns that we’ve heard from the community. Of course, we know that this is a continuous process and there’s still plenty to do. To that end, we welcome your feedback. Love it? Hate it? Something not quite right? Comment on this blog entry, post a message on our forum, or tweet us @PreEmptive. Anything you write will go directly to those of us on the Runtime Intelligence portal development team, and if your suggestion is a good one you can look forward to seeing it implemented in a future portal update.

Dotfuscator Windows Phone Edition - Now Available!

Friday, January 7th, 2011 by David Poeschl

We recently released a brand new version of Dotfuscator, Dotfuscator Windows Phone Edition!  It is completely free to use and has all of the instrumentation and obfuscation features of the commercial version, but is specifically designed for developers of Windows Phone 7 applications!

The purpose of this post is to get you started with mobile application analytics and obfuscation using Dotfuscator, assuming no prior knowledge.  If you don’t have your own application to try it out on, we provide both Silverlight and XNA applications (including source code) to use for testing.  Let’s get started.

Getting Dotfuscator Windows Phone Edition

Getting Dotfuscator Windows Phone Edition is as easy as filling out one simple form.  We’ll wait here while you go fill it out…

Very shortly after form submission, you will receive an email containing a link to download Dotfuscator Windows Phone Edition, a serial number for registering the product, and various credentials required to properly instrument your application and use the Runtime Intelligence portal to view application analytics.

It is important that your Organization name be distinct.  If it is not distinct (for example, if you and a coworker both enter "Foo Company"), then the license email you receive will not contain RI credentials.

Sample Applications

Dotfuscator Windows Phone Edition comes with two sample applications - one Silverlight application and one XNA game.  They include the original source code, Dotfuscator configuration files for obfuscation and instrumentation, and a link to the Runtime Intelligence Portal where application usage statistics can be viewed (found in the readme.txt of each sample).

The configuration files include best practices for application analytics & obfuscation that you can view, adjust, and apply to your own applications.

To run the sample configuration files through Dotfuscator, first copy the entire samples directory to C:\temp or any location over which you have full control (otherwise you may encounter one of two errors - a file access build error, or an ilasm.exe build error when we try to create the output assembly).  Then simply open the Dotfuscator configuration file included in the sample and click the build button.

Instrumenting Your App

Instrumentation is enabled by default, but no analytics will be collected until you use the Instrumentation tab in Dotfuscator to set the required attributes.

At a minimum, you’ll need to add a BusinessAttribute (using a GUID provided by PreEmptive in the registration email), ApplicationAttribute (to distinguish between your applications), SetupAttribute & TeardownAttribute (to track application runs, and to set up the runtime environment through which more advanced messages can sent).

Due to how application lifecycles are handled on the phone, you may need to be careful where you put your SetupAttribute & TeardownAttribute.  To get up and running with an XNA game, we suggest putting the SetupAttribute on the Initialize() method, and the TeardownAttribute on a method tied to the game’s Exiting event.  To get up and running with Silverlight apps, we suggest putting a SetupAttribute on both Application_Launching() and Application_Activated(), and the TeardownAttribute on both Application_Closing() and Application_Deactivated().

That’s all you need to do to start tracking application runs! You can collect more information, such as feature runs, feature durations, performance information, and custom data in the form of extended key dictionaries (any IDictionary<string, string>).  Check out the sample applications for examples of feature tracking & using extended key dictionaries to track things like the final score of a game.

Viewing Your Analytics

To view your analytics data, go to the Windows Phone 7 Runtime Intelligence Portal and login using the credentials from your registration email.

It can take up to 24 hours for your data to process fully and appear in reports.  You can still tell whether you have successfully instrumented your application by using the Queued Data report on the Account Overview page.

If you see no data in reports or in the Queued Data report, there’s a list of common reasons in this thread.

Obfuscating Your App

Obfuscation is fully disabled by default for new projects.  You will need to turn on each desired transform individually from the Settings tab.  The most useful features for Windows Phone 7 are Renaming, Control Flow, and String Encryption.

When you turn on Renaming or Control Flow, Dotfuscator will apply those transforms to everything in the assembly that it can (while making intelligent automatic exclusions for you in the case of certain types of reflection or XAML references).  You may need to make Renaming exclusions to compensate for certain types of reflection using the Rename | Exclude tab.  A number of these cases specific to Windows Phone 7 development are addressed in this thread.

When you turn on String Encryption, you need to use the String Encryption | Include tab to specify which strings you want to be encrypted.  To select them all, either check the box on each assembly node in the treeview, or add just one custom rule on the right by clicking "Add Namespace" and changing the Name to ".*" (without the quotes).

(For the purposes of String Encryption, it helps to turn on Removal, and change Removal | Options | Removal Kind to "Remove only literals (const definitions).")

Having Trouble?

Here’s a quickstart video that demonstrates obfuscation, instrumentation and analytics for both XNA and Silverlight applications.

If you’ve instrumented your application but are not seeing your data on the Runtime Intelligence Portal, please read this thread first.

If you’ve obfuscated your application and now it won’t start, please read this thread first.

If you encounter any problems, please search or post on our specific Windows Phone 7 analytics forum or Windows Phone 7 obfuscation forum.

Obtaining opt-in consent: The responsible way to collect application analytics

Wednesday, December 15th, 2010 by Brandon Siegel

Runtime Intelligence is a powerful tool that is able to illustrate in great depth how your applications are actually being used. But of course, with great power comes great responsibility. While individual developers are free to collect analytics data in any way and in accordance with any privacy policy they wish, allowing your users to opt-in to collecting usage information is not only standard in the industry, it’s also the right thing to do for your users. With Runtime Intelligence, we’ve make this important functionality easy to implement via the OptInSource properties of the SetupAttribute. Simply specify the name and owner of the property, method, field, or method argument that will contain the user’s opt-in setting at runtime, and the instrumented Runtime Intelligence code will retrieve the opt-in setting before any attempt to send analytics data.

If the user has opted-out, no data will be collected or sent in nearly all cases. The exception to this rule is that if you have chosen to use Tamper Detection and Notification, and you have configured it to send Runtime Intelligence messages when tampering is detected, these messages will always be sent regardless of the user’s opt-in choice. Additionally, the Exception Reporting feature contains a mechanism that allows the user to specify an explicit opt-in for an individual exception report, which will override the Runtime Intelligence opt-in setting for that message only. The default exception reporting dialog that Dotfuscator can inject makes use of this mechanism, and the specifics of how to provide this explicit opt-in are detailed in the manual so that developers rolling their own solution using Exception Reporting can do the same.

As a quick example, let’s say I wanted to persist the user’s opt-in setting using Isolated Storage. For simplicity’s sake, I am using the IsolatedStorageSettings class available in Silverlight and Windows Phone 7, but applications that target other frameworks can perform the same operations in a slightly more verbose way. Your business requirements would of course drive the value of RIOPTIN_DEFAULT; for this example I have chosen to opt-in the user by default.

public static class UserPrefs {
    public static bool RIOPTIN_DEFAULT = true;

    public static bool RIOptIn {
        get {
            bool optIn;
            if (IsolatedStorageSettings.ApplicationSettings.TryGetValue("rioptin", out optIn)) {
                return optIn;
            } 

            return RIOPTIN_DEFAULT;
        }
        set {
            IsolatedStorageSettings.ApplicationSettings["rioptin"] = value;
            IsolatedStorageSettings.ApplicationSettings.Save();
        }
    }
}

Now all I need to do is set the following properties on my SetupAttribute (either in code, or via Dotfuscator’s Instrumentation tab), and my users will be able to rest easy, knowing that they have control over whether and how their activity data is shared.

[Setup(
    ...,
    OptInSourceElement = SourceElements.Property,
    OptInSourceName = "RIOptIn",
    OptInSourceOwner = "UserPrefs",
    ...
    )]

You can see a complete example by checking out the awesome open-source OneBusAway app at http://onebusawaywp7.codeplex.com. The Runtime Intelligence opt-in preference is wired up via data binding to a toggle in the app’s settings scene, and is persisted in the same way as my sample above (property backed by isolated storage). They’ve included their Dotfuscator config file in source control, so you can take a look at a real-world example if need be. The OneBusAway project is also a great example of our exciting partnership with CodePlex that provides free, integrated Runtime Intelligence analytics to all the projects they host, so definitely check it out!

Launch of Visual Studio 2010 & Dotfuscator CE 5

Monday, April 26th, 2010 by Brandon Siegel

With the launch of Visual Studio 2010 and Silverlight 4 at the DevConnections show in Las Vegas last week, I am pleased to announce that Dotfuscator CE version 5 is now generally available. With an all-new user interface, more intelligent obfuscation, and application analytics instrumentation, this promises to be the biggest change we’ve made to Dotfuscator CE in its history. I am particularly excited because soon, with the application analytics included in Dotfuscator CE, millions of developers world-wide will have the opportunity to see real usage data coming in from their applications. Even better, they will be able to do so completely cost-free.

I was invited to act as part of PreEmptive’s delegation to the launch event and humbled to speak with so many passionate developers, architects, DBAs, and yes – even managers. What I did not initially expect was the overwhelmingly positive response from nearly everyone we talked with. Most people had never heard of application analytics. But, with a brief introduction everyone quickly understood the idea and many offered up scenarios where they would want to use it for their applications (completely unsolicited, I might add). It was thrilling to receive such a positive response to something I - and the other fantastic developers here at PreEmptive - have worked very hard over the past few years to create.

I very much encourage the great folks I met in Las Vegas last week, along with millions of passionate developers across the globe, to open up Dotfuscator CE and try out the free analytics we’ve included. Today, most web developers wouldn’t think of publishing a web site without including web analytics. I hope that having these analytics included with Visual Studio 2010 will lead to application developers thinking the same way about their applications. Of course, using the two together in a Silverlight or ASP.NET application to get a complete view of the visitor’s experience is a natural fit. But application analytics extends far beyond that. Now, all .NET developers are able to get live information that can help steer development focus, even in areas that were previously completely opaque – from cloud apps running on Windows Azure to mobile phone applications on Windows Phone 7 and even to applications running on Linux and Mac with Mono.

In fact, I look forward to seeing how application analytics will be used to support open source development throughout the .NET ecosystem. Because open source developers essentially donate their spare time, being able to focus their efforts in places that have the most user impact is crucial. An open source development model also allows far greater flexibility for developers to immediately shift their focus to match what their users are actually doing with the software they produce, without the constraints of rigid development and deployment practices. Because of these factors, I specifically encourage maintainers of open source projects to try the free application analytics provided in Dotfuscator CE. Together with the bug reports and feature requests you already have, you will be able to truly make the most of the precious time that your contributors give.

Some might say that it’s counterintuitive for a company known for source code obfuscation to support open source development, but at PreEmptive our guiding principle is simply “help software succeed”. With application analytics, we have the opportunity to extend our dedication to this principle beyond proprietary software. In the past few months, we’ve released numerous projects on CodePlex including some awesome editor extensions that integrate application analytics right into the Visual Studio 2010 IDE, an endpoint starter kit so you can write your own backend to receive and process Runtime Intelligence messages, a data visualizer sample to demonstrate how to consume analytics data using our RESTful analytics API, and an API helper library to make using our API even easier. And our new partnership with CodePlex, which will provide free application analytics for hosted projects surfaced right within each project’s page, provides us yet another great opportunity to help software succeed.