Wednesday, April 29, 2009

Q4Tech Mobile Updater Application Block is now part of Mobile Contribute

Q4Tech has moved its open source Mobile Updater Application Block as part of the Mobile Contribute Project at CodePlex, under the MS-PL license.

The block hasn’t been upgraded yet, and it stills targeting VS 2005, .Net CF2.0 and WM 5.0, but it was definitely a good move, and being in a community contribution project we can expect seeing it alive for a long time and hopefully we will see an updated updater soon ;)

Friday, April 24, 2009

Using Balsamiq Mockups to design a Windows Mobile app UX

UPDATE (7/17/2012): Please use this link for downloading the template.

As you probably already know, or are just about to realize, the success of any mobile application mostly depends on the user experience it provides. Besides how functional is a device which can be easily transported with you, the reduced size and autonomy required makes it a resources constrained machine not only in terms of processor, battery life and memory, it’s constrained also in terms of screen size and user interaction capabilities.
In fact, most of the mobile applications should interact with users without a mouse, a full sized hardware keyboard or even without any hardware keyboard at all. What’s worst, the apps should show the information and allow input in a very small screen. If you take in account that the scenario is even more complex because your UI would need to target several form factors and orientations, the UX design is something that you should be focused on and work on very seriously from the beginning of your development.
A great way to get the feeling of a UX before of building it is drawing mockups. You can do it by hand or using some tools around there, like Microsoft Office Visio and some custom stencil add-ins available on the web.
One tool I really like is Balsamiq Mockups. You can build mockups having a relaxed hand-drawn look’n feel which is great for sending a clear UX message without the noise of design specific elements like icons and so on. This way, the customer knows that you’re showing a just a mockup, not screenshots, and at the same time he gets clearly what is the UX you’re proposing.
A sample mockup of a login screen with the keyboard open can look like this:
image
And an Outgoing Orders list screen can look like this:
 image
Really cool stuff, isn’t it? You can understand clearly what are the space constraints in your design and how the user should interact with the UI elements. Building a mockup you’re actually designing the real full User eXperience for your app.
Unfortunately, Balsamiq doesn’t include Windows Mobile mockups templates out of the box. But I did the homework, and included the template I built for default WM Professional Edition into their MockupsToGo templates site.
You can have a look at it and download it following this link: Windows Mobile Professional Edition Mockups.  (The old link doesn't work anymore, please use this for download it.)
I’ll add some extra form factors later so we can build mockups for square screen and Standard Edition also.
I really like this tool, but I should also say that there are a couple of things that I don’t like about Balsamiq:
  • It relies on Adobe Air
  • It doesn’t have any freehand drawing tool.
  • It lacks of some basic UI and annotation elements.
The good news is that it stills growing up, and having custom templates you can use it as a great mocking tool for windows mobile applications.
Hope you find it as useful as I do!

Wednesday, April 22, 2009

How to convert an existing Smart Device project into a Smart Device Unit Testing Project

Since I posted about Smart Device Unit Testing using the integrated Visual Studio 2008 Testing Framework, I got a couple of questions regarding how to convert an existing project to a Smart Device Unit Testing Project. Well, let me try to help with the port on this post.

1. It must be a .Net Compact Framework 3.5 project

First of all, a Smart Device Unit Testing Project is a .Net Compact Framework 3.5 Class Library project. So, you may need to upgrade your project to the latest .Net CF version (In Solution Explorer right click your project and select Upgrade Project).

2. Add Visual Studio Testing Framework References

Right click on References folder and select “Add Reference”. Switch, if you’re not already in, to the Browse tab and enter the path of the UnitTestFramework assembly for smart devices which typically is on

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SmartDevice.UnitTestFramework.dll

3. Include the Smart Device Unit Testing TypeGuids

Open the project source code. You’ll need first to unload the project by right clicking on it and selecting "Unload Project”. Next, please right click on it again and select "Edit Project File”.
The .csproj project file is an xml file containing project definitions. Please look for the <ProjectTypeGuids> element, and replace it with the following:

<ProjectTypeGuids>{73A5A715-AF05-47af-9C33-47A864AF9AE7};{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Save the file and right click on your project again and select “Reload Project”. If Visual Studio asks for your confirmation please select Yes.

4. Add a Test Run Configuration File

Now your Smart Device project has been turned into a Smart Device Unit Testing Project. But you need to define at least one .testrunconfig file targeting the emulator or an actual device to run your tests. If you are not familiar with how to add a test run configuration file, please take a look at this post.

5. Make your tests build and start running them!

It’s time to build your code… and just run the tests on the target platform of your choice!.

Piece of cake! Isn’t it? ;)

Friday, April 17, 2009

What’s new on the Mobile Application Blocks Community Drop (03-31-2009)?

It was two weeks ago, but we have a new community drop on the CodePlex site for the Mobile Application Blocks.

This new community drop includes the return of the Subscription Block as part of the project. It hasn’t been included on the previous drop but it was ported and included now.

The other major change was the integration of great updates from the Microsoft Dynamics Mobile product team. They did several wonderful improvements around the Configuration Block, the Connection Monitor Cell Connection, Subscription Block, Endpoint Catalog and the Disconnected Agent. Those improvements have been integrated in our code base in a TDD approach.

One interesting addition was the IWSCredentialService interface as part of the Disconnected Agent Block. This is a side effect of an new abstraction on the Endpoint Catalog.

The Endpoint Catalog is the responsible to provide information required to access a logical endpoint as the URL address and authentication related data depending on an specified network name. E.g. you may need to consume a web service and for your application this web service can be identified with a logical name such as “ProductsService”. That web service can require different URL addresses and even different credentials for different networks, so if you’re connected to the internet you may need to use:

URL: “http://mycompany.com/services/productsservice/
Username: joe.mycompany.com
Password: xxxxxx

But if you’re connected to the intranet, you can access it directly using the following information:

URL: “http://services/productsservice/
Username: joe
Password: xxxxxx

The Endpoint Catalog used to address this issue by providing a catalog with default configuration and specific configuration by network name for a logical endpoint name. This configuration information used to include the address and credentials (username, password and optionally the domain). This information is retrieved from the configuration file, which can be encrypted to keep your data safe.

That approach was good, but it carries on with two issues:

1. We don’t have a clear entry point to inject a service that can ask the user for credentials if needed.

2. We don’t have a way to reuse credentials for several endpoints or networks.

To address both issues, the Dynamics Mobile group has included a new abstraction of the credentials resolution, defining that the endpoint catalog won’t include the authentication details anymore, but only an account name. So, you can now specify that your endpoint configuration from the internet is:

URL: “http://mycompany.com/services/productsservice/
AccountName: “MyInternetAccount

And we can point several endpoint configurations to reuse the same account by using the same account name.

At the same time, when we need to inject i.e. the actual credentials into the web service proxy, we can use a Credential Service to resolve this account name to actual credentials.

This is what we’ve included as part of the Disconnected Agent. A new IWSCredentialService and a default implementation that retrieves the credentials for each account name from the configuration file named the ConfigurationCredentialService. With this interface, you have now a good customization point where you can inject your own Credential Service which would ask the user for credentials for a given account name when needed.

I’ll talk later about the Connection Monitor design changes, but in the meantime I invite you to download the drop from http://mobile.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25565 and take a look at the full list of changes on the wiki Changes from MCSF v1.

I suggest you also take a look at this great introductory post of Kzu regarding the new Container Model block.

Have a nice weekend!