TFS Preview in service maintenance

by Fabien Lavocat 26. April 2012 09:05

image

Microsoft is performing a service maintenance on TFS Preview (TFS hosted on Azure) today. So you’ll probably notice this error message when trying to connect: TF30040: The database is not correctly configured. Contact your Team Foundation Server administrator.

The service should be back online very soon and the maintenance will be done by Friday 27th 9 AM PDT.

image

I suggest you to follow the account @tfservice on Twitter and the blog TfService for the last updates.

Tags:

Visual Studio

Microsoft MVP Client App Dev 2012

by Fabien Lavocat 3. April 2012 10:13

Fb

On Sunday April 1st 2012, I’ve received for the third year in a row, the Microsoft Most Valuable Professional (MVP) award on the category Client Application Development. It is always an honor to receive this award. I hope to be able to go to the MVP Summit next year and meet again all other MVPs from around the world.

I’m trying, at work and out of work, to focus my developments on WPF and Windows Phone technologies, so I’ll continue to publish source code, projects, articles and new applications on the Microsoft Marketplace. Please, have a look at my application for Windows Phone 7.

Tags:

Fabien Lavocat

Windows Phone SDK 7.1.1 now available

by Fabien Lavocat 26. March 2012 10:47

Windows Phone 7

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:

Tags:

Windows Phone

How to detect a 256 MB Windows Phone 7 device

by Fabien Lavocat 16. March 2012 08:25

Windows Phone 7

Last Wednesday I talked about a very good article from Nokia on the Best practices for developing on Windows Phone 7 Tango (256 MB devices). Today I’m going to show you how to detect if your application runs on a 512 MB device or 256 MB. Because you probably can’t have the same features in your applications for a “classic” device than on a “low-cost” one, you must be able (without coding a specific version of your application) to detect the capabilities of the current device and adjust the features accordingly.

So here is the code you have to implement at the start of your application. You can store the result (the variable IsLowMemoryDevice) into the application settings in order to avoid to call this method every time.

private void DetectMemoryDevice()
{
    try
    {
        // Gets the application working set limit. (if available)
        long memorySize = (long)DeviceExtendedProperties.GetValue("ApplicationWorkingSetLimit");

        // If the application has more than 90 MB
        // it indicates a 512-MB device.
        IsLowMemoryDevice = memorySize < 94371840L; // == 90 MB
    }
    catch (ArgumentOutOfRangeException)
    {
        // Windows Phone OS update (7.1.1)
        // is not installed, which indicates a 512-MB device. 
        IsLowMemoryDevice = false;
    }
}

Then you can use the variable IsLowMemoryDevice to activate or deactivate the features in your application.

Tags:

Windows Phone

Update of Bugsense SDK for Windows Phone 7

by Fabien Lavocat 15. March 2012 07:37

BugSense

The 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. Check your updates!

image

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);

Tags: ,

Windows Phone

Best practices for Windows Phone Tango with 256 MB

by Fabien Lavocat 14. March 2012 09:24

Windows Phone 7Microsoft 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

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>

Tags: ,

Windows Phone

C# 5.0 - Caller Information

by Fabien Lavocat 12. March 2012 13:51

Visual Studio 11One of the new feature I really like in C# 5.0 was introduced for the very first time at the Microsoft BUILD in September 2011 in California. Microsoft presented to the world of the developers the next Windows and the APIs WinRT. Today I' would like to talk a bit about the Caller Information. This feature consists of the use of the attributes CallerFilePathAttribute, CallerLineNumberAttribute and CallerMemberNameAttribute. These attributes can be use with optional parameters in a function, method, delegate, Property…

The basic usage of this feature is when you want to implement a log system in your software. By writing the following code, you can retrieve the calling member name, the number of the line of code that called this method and the file path without having to do reflection or anything by yourself.

public void Do()
{
    Log("Example");
}

public void Log(string message,
        [CallerMemberName] string memberName = "",
        [CallerFilePath] string sourceFilePath = "",
        [CallerLineNumber] int sourceLineNumber = 0)
{
    // Implement your log system
}

Another cool usage is with the interface INotifyPropertyChanged. In C# 4 and before you have to write the following code in order to raise the event PropertyChanged when you update the property Name.

public class Product : INotifyPropertyChanged
{ #region Name private string _name; /// <summary> /// Gets or sets the Name. /// </summary> public string Name { get { return _name; } set { if (value == _name) return; _name = value; NotifyPropertyChanged("Name"); } } #endregion #region INotifyPropertyChanged public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(String propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } #endregion
}

The problem here, is when you have several properties and you want to do a basic Copy & Paste. If you’re doing it too fast, you' could forget the line NotifyPropertyChanged("Name"); or type a wrong property name and because it is a string value, your Visual Studio or ReSharper will not say anything, and the compilation will not crash. So in C# 5.0 you can write it like that:

public class Product : INotifyPropertyChanged
{ #region Name private string _name; /// <summary> /// Gets or sets the Name. /// </summary> public string Name { get { return _name; } set { if (value == _name) return; _name = value; NotifyPropertyChanged(); } } #endregion #region INotifyPropertyChanged public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } #endregion
}

Tags:

C#

Visual Studio 11 Beta is now available

by Fabien Lavocat 29. February 2012 17:08

Visual Studio 11

Today is a big day event for the Microsoft community, but not only for the developers. Microsoft have released early this morning Windows 8 Consumer Preview and the Visual Studio 11 Developer Preview. I installed it today on the Samsung tablet Microsoft provided to the BUILD attendees in September 2011. I didn’t find out how to install directly Windows 8 from the USB key, so I had to start it from the previous Windows 8 and then remove the old Windows. The installation is very fast, in less than 30 minutes, no manual action, I was on the new Metro interface. Yes I say new, because the interface is a bit different than the previous public version, it seems more smooth, clear.

Download Windows 8 Consumer Preview.

The next step was to install Visual Studio 11. It was, at my astonishment, a very fast installation, considering that Expression Blend 5 is part of the package. The first impression is, wow! On the tablet Windows 8, the theme of Visual Studio is very bright, and I don’t think I’ll like to develop anything on it.

VS11 Light

If you go to the menu Tools | Options, in the Environment part, you can set the theme you want to use for your interface. Basically you can choose between Light and Dark (I hope we will be able to add more theme in the final version). Let’s try to use the dark theme:

VS11 Dark

It looks like Expression Blend. What do you think? Live me you feeling about this new design of the interface. I like the dark theme so far, but if you look at the Solution Explorer, the icons are not very easy to distinguish. But I guess after using it more and more I’ll get used to it.

SolutionExplorer

The last screenshot I would like to show you is the interface of Expression Blend 5 that is included in the installer of Visual Studio 11.

Blend5ABlend5B

Download Visual Studio 11 Developer Preview. On this page, you can download Visual Studio 11, Team Foundation Server 11 Express and Full and all other product of Visual Studio…

Tags:

Visual Studio

Skype beta is available on Windows Phone

by Fabien Lavocat 27. February 2012 16:22

Skype

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.

wp7_button_blue

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

Tags: ,

Windows Phone

Windows Phone SDK 7.1.1 Update CTP

by Fabien Lavocat 27. February 2012 11:45

Windows Phone 7

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.

Tags:

Windows Phone

About

Fabien Lavocat
Lavocat Fabien
Software Engineer - Radiant Logic Inc
San Francisco, CA

MVP
Microsoft Most Valuable Professional
Client Application Development

Month List