Windows Phone

Windows Phone SDK 7.1.1 now available

Windows Phone logo

Microsoft has published this morning the final version of the Windows Phone SDK 7.1.1. You can now download it, create your applications and publish them on the Marketplace. There are two major improvements in this update. First, you can now create and test your applications for the new 256 MB devices. The Windows 8 early adopters will be pleased to see that the emulator provided by this SDK now supports Windows 8!    Another good news is that you don’t need to uninstall the previous version, you can simply install the new version on the top of the previous one.

Download the Windows Phone SDK 7.1.1.

Some links:

Update of Bugsense SDK for Windows Phone 7

BugSenseThe team BugSense updated few weeks ago the SDK for their platform for Windows Phone 7. If you never try it I suggest you to read this post Mobile bug tracking with BugSense. If you already use it in your mobile application, update the SDK is very easy and requires less than 5 seconds. Right click on your solution, then:

image_9

Check your updates!

image_10

You’ll have then only one change to do, the following method is now deprecated:

BugSenseHandler.HandleError(e.ExceptionObject);

You must change it by:

BugSenseHandler.Instance.LogError(e.ExceptionObject);

Best practices for Windows Phone Tango with 256 MB

Windows Phone logoMicrosoft is about to release Windows Phone Tango (March 21st in China), the “light” edition of the mobile OS for low-cost devices. This OS update will support devices with only 256 MB, but in order to do that, we (developers) will have to work a bit more on the performance of our applications. Only 90 MB will be available for the application that is currently running, but Microsoft suggests to use less than 60 MB because the gap between 60 MB and 90 MB will be paged so for better performance, so, stay below 60 MB. The other thing you should know is that the Background agents are not supported on 256-MB devices.

Some Windows Phone developers already received this email from Microsoft to warn them that their applications are too heavy to run on the “low-cost” devices.

image_8

Nokia published an excellent best practices document that provides a very good opportunity for you to improve the performance of your applications.

Best practice tips for delivering apps to Windows Phone with 256 MB by Nokia.

You can of course forbid your application to be run on a Tango device by adding this line in the WPAppManifest.xml file:

<Requirements>
  <Requirement Name="ID_REQ_MEMORY_90" />
</Requirements>

Skype beta is available on Windows Phone

Today, Monday February 27th, is the first day of the Mobile World Congress (MWC) in Barcelona, Spain. Every mobile constructors, integrators, software developer company are presenting their new products. Nokia announced few new Windows Phone, the Lumia 610 and the Lumia 900.

 

Microsoft presented the official application Skype beta for Windows Phone 7! The final release is planned for April of this year.

 Skype-5 Skype-4 Skype-3 Skype-2 Skype-1

 

 

Windows Phone SDK 7.1.1 Update CTP

Windows Phone logo

Microsoft has published yesterday an update for the Windows Phone SDK. This package contains an update for the current emulator, and a new one for the future Tango version of Windows Phone. Just a reminder, the Tango update will permit to have devices with less memory and features to get a very low cost than the high-end phones. So this emulator will allow you to test your applications for the 256MB Windows Phone devices.

This version does not contain the GO LIVE license, so it is forbidden to publish applications using this SDK!

Download the Windows Phone SDK 7.1.1 Update CTP.

Take a screenshot of a FrameworkElement on Windows Phone 7

Windows Phone logoIn my application Earthquakes, if you try it (and I’m sure you already did 🙂 ) you probably noticed that you can take a screenshot of the application and send it by email, by text… Anyway, it is not very tricky to take a screenshot on the current page in Windows Phone 7. Here is the code.

String tempJpeg = "TempJPEG.jpg";

try {
    // Capture the screen (this) and apply no transformation<>  WriteableBitmap bmp = new WriteableBitmap(this, null);

    // Get a virtual store file to temporarily store the image var store = IsolatedStorageFile.GetUserStoreForApplication();
    if (store.FileExists(tempJpeg))
        store.DeleteFile(tempJpeg);

    // Create the file in the store     IsolatedStorageFileStream myFileStream = myStore.CreateFile(tempJpeg);

    // Save the WriteableBitmap into JPEG stream and place into isolated storage file. bmp.SaveJpeg(myFileStream, bmp.PixelWidth, bmp.PixelHeight, 0, 100);
    myFileStream.Close();

    // Create a new file stream. myFileStream = myStore.OpenFile(tempJpeg, FileMode.Open, FileAccess.Read);

    // Put the JPEG file to the photos library on the device. using (MediaLibrary library = new MediaLibrary())
    {
        library.SavePicture("image.jpg", myFileStream);
    }
    myFileStream.Close();
}
catch (Exception) { }

If you want to save only a FrameworkElement instead of the whole page, you can just change this in the first line and use the object you want.

However, a user of the application (thanks to him) noticed a big issue with in my application. If you use the light theme and try to take a screenshot to share, the screenshot appears to be black with only the Bing map. All the text disappears. The problem is that the background of the PhoneApplicationPage is not used in the render of the bitmap, Black is used instead. So in order to fix this problem, you have to define the background on your main container, in the example below I define the Background on the Grid and use the resource PhoneBackgroundBrush.

<phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            x:Class="Demo.Screenshot"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            mc:Ignorable="d"
                            d:DesignHeight="696"
                            d:DesignWidth="480"
                            shell:SystemTray.IsVisible="True">

    <!-- You must define here the background with the resource PhoneBackgroundBrush instead of Transparent -->
    <Grid Background="{StaticResource PhoneBackgroundBrush}">

    </Grid>

</phone:PhoneApplicationPage>

And after that, it works very well!

Wp7EarthquakeLight Wp7EarthquakeDark

Now, please try Earthquakes for Windows Phone 7, it’s free!

 

Windows Phone 7 Applications Requests

Windows Phone logo

Around me, a lot of people complain about Windows Phone 7 and its lack of applications if you compare to the iPhone AppStore or the Android Market. In order to help to change that, the Microsoft MVP Scott Dorman has created a forum on UserVoice to list all applications that will be great to have on the Microsoft Market Place. There are 60,000 applications available today for the Windows Phone 7, it’s nothing compare to the 725,000 available on the Apple AppStore (source Wikipedia), and the 400,000 on the Android Market (source Wikipedia). This website will help companies to see the need of an application for the Microsoft mobile OS, but also for the developers without idea (like I am…).

I suggest that you have a look at the Marketplace Requests website today.

image_7

Codeplex OAuth providers for .NET Framework 4.0 and Windows Phone 7

File:Oauth logo.svg

The project

I started few weeks ago, a new project that allows me to do trading using the APIs provided by E*Trade. The authorization system used is OAuth. My first idea was to create a Windows Phone 7 application for E*Trade, what I started to do. Did you already try to debug web services that you don’t control? Especially when the documentation is not very good. When you send a bad request to the server, you always get the same answer:  The remote server returned an error: NotFound. But what does it mean? Basically everything. That’s why I created a new WPF project to have the full .NET Framework in order to get more information and help me to debug the Web service calls.

What libraries I use

I’m using the Reactive Extensions (Rx) to “wrap” my asynchronous event into observable objects. Then, because E*Trade APIs are based on OAuth protocol for the authorization of the users, I needed an library that helps me to send queries to the server. I’m using the project ReactiveOAuth because it is one of the best I found. I just had to use the source code and modify it, because it was originally created for Twitter, and it seems that every single OAuth provider does not respect the standards.

What’s next

I decided to publish the full source code of my project via CodePlex under the name OAuth Providers. I currently published an updated version of ReactiveOAuth and a basic SDK for E*Trade. I also included an example using WPF that connect to E*Trade and download some stocks information. I’ll publish soon an update of the SDK that will contain more API support.

My next objective is to publish more and more SDK for OAuth providers like Twitter, Facebook, LinkedIn, Foursquare…

Download the SDK

BugSense New pricing and XNA support for Windows Phone 7

BugSense

Last October, I blogged about how to use BugSense to track bugs into your mobile applications. Today, the startup of San Francisco announced a new pricing for their service. You can start for free, to $299 a month. As a reminder, with a very small package installed in your application, you can track any unhandled exception (when your application crash) or any other error you want to analyze. They updated the dashboard, the place where you can track any problem reported by your customers. This dashboard is evolving very often to give you a better user experience. Here is a screenshot of the dashboard for one of my applications for Windows Phone 7.

 Bugsense

About the pricing, for all the developers of small applications, with not many thousands of users, you can use this service for free! The major limitations are 500 errors a month and only one viewer. But if your business is growing up, you can still upgrade your plan to $19 a month to be allowed to send up to 25.000 errors a month. Have a look at the prices on BugSense for more details. All the plans allows you to create as many applications you want, even with the free plan! If you are an open source application developer, do not hesitate to contact them, they can offer you a Premium plan for free!

Since the last time I blogged about it, they introduced the support of XNA on Windows Phone 7. It means, you can now, track problems in your games! To use it, it’s still very convenient, you can use NuGet to get the packages and install it into your application / game.

My opinion about these price is that the limit of 500 errors a month of the free plan can be reached very fast if your popularity on the marketplace grows. But the price of the next plan, $20 a month, could be a bit expensive. Maybe an intermediate plan, with “only” up to 5,000 errors would be a good alternative. But don’t forget that you can monetize your application with Microsoft Advertising (not available in every countries).

I’m using BugSense in my applications for Windows Phone 7 to track all bugs. The biggest part of the problems come from the applications Earthquakes because the number of downloads is pretty high (thank you for that), but it’s usually only minor issues, and thanks to BugSense I can catch them very quickly, with the email sent to alert you when you receive a new unknown crash. So I can very quickly fix the problems, now the slowest part is the certification on the Microsoft Marketplace, that takes almost a week to validate an update. Please Microsoft improve the certification process!!!

Follow @bugsense on Twitter. Then have a look at their website.

Mobile bug tracking with BugSense

BugSenseToday I’m gonna talk about a new service I discovered yesterday, bugsense. This free tool is used to report crash of your mobile applications (iPhone, Android, Google AppEngine, BlackBerry or Windows Phone 7) and send to the developer a notification, then a web tracking system will help you to know what is needed to fix. You’ll ask me, why this tool is free? The business model (according to the FAQ) is that some future features will be available only with a premium account.

Let’s talk about features.

analytics

From your interface, your dashboard, you can track the number of exceptions raised by your applications every days, weeks, months. You can also track the list of bug you already fixed and the pending list.

image_103

As you can see, for an exception, you can see the stack trace, and a lot of information concerning the device, like the OS version, the country, the application version, the application name… A bug has two states, Unresolved and resolved. It allows you to track, filter and sort easily what you have to do for the next release of your application.

image_104

You can also invite other developers of your team to track the bugs in the same dashboard.

How to implement it into your applications.

It is very very easy! Do you know NuGet? Just install the package BugSense for Windows Phone into your project.

nuget

You’ve first to initialize the service by providing the application handled and your API Key (This key is given when you create a new application on the BugSense dashboard). Update the constructor of the class App.

/// <summary> /// Constructor for the Application object. /// </summary> public App()
{
    // Define the instance of BugSense
    BugSenseHandler.Instance.Init(this, API_KEY);

    // Global handler for uncaught exceptions.
    BugSenseHandler.Instance.UnhandledException += Instance_UnhandledException;
}

Then we have to modify the way to raise unhandled exception raised by your application. You can remove the line UnhandledException += Application_UnhandledException; from the constructor, and we will create our own handler.

// Code to execute on Unhandled Exceptions private void Instance_UnhandledException(object sender, BugSenseUnhandledExceptionEventArgs e)
{
    // Use BugSense to report the exception
    BugSenseHandler.HandleError(e.ExceptionObject);

    if (System.Diagnostics.Debugger.IsAttached)
    {
        // An unhandled exception has occurred; break into the debugger
        System.Diagnostics.Debugger.Break();
    }
}

popup-wp7

So now, when a unhandled exception is raise in your application, this popup is displayed. When the user click OK, a report is sent to your dashboard, and an email is sent to your mailbox (if you activated the notification). You can, of course, customize the popup and the error message.

So, if you want to try the service BugSense for free, check it out http://www.bugsense.com/