Archive for category wp7

Using WP7’s Secondary Tiles with Caliburn.Micro

There’s good guide on how to manage WP7’s Secondary tiles on MSDN.

So, how are you doing it with Caliburn.Micro? Take same way, it just works!

However, there’s a small touch of Caliburn.Micro goodness you can add to your code to make it more maintainable. When you’re setting the URI for your Tile, use the INavigationService.UriFor<>() extension method. This will make your code a little more friendly for an eventual refactoring and for sure will save you from few nasty bugs.

Sample code:

var newTileData = new StandardTileData
{
    Title = "my tile",
    BackTitle = "my tile details",
    BackContent = "description",
};

ShellTile.Create(navigationService.UriFor<MyViewModel>()
                     .WithParam(x => x.ViewModelParameter, "some value")
                     .BuildUri(),
                 newTileData);

Piece of cake!

,

Leave a Comment

Using WP7′s ProgressIndicator with Caliburn.Micro

The Windows Phone SDK 7.1 introduced a new control to show the progress of long operations or interactions, ProgressIndicator. As I love much the Caliburn.Micro framework I got some time to integrate neatly ProgressIndicator with the rest of application and services using Caliburn’s container.

First of all, let’s define our application facing progress service:

public interface IProgressService {
    void Show();
    void Show(string text);
    void Hide();
}

Pretty simple, yes…

The implementation was partly inspired by Jeff Wilcox’s article about creating a global ProgressIndicator.

It’s pretty simple and straightforward: we’re getting the Root Application Frame and hooking up to the Navigated event. His arguments contain the page being navigated to. Then we’re attaching our instance of ProgressIndicator to that page. And the service uses Show/Hide methods to manipulate the state of indicator. The code:

public class ProgressService : IProgressService {
    const string DefaultIndicatorText = "Loading...";
    private readonly ProgressIndicator progressIndicator;

    public ProgressService(PhoneApplicationFrame rootFrame)
    {
        progressIndicator = new ProgressIndicator {Text = DefaultIndicatorText};

        rootFrame.Navigated += RootFrameOnNavigated;
    }

    private void RootFrameOnNavigated(object sender, NavigationEventArgs args)
    {
        var content = args.Content;
        var page = content as PhoneApplicationPage;
        if (page == null)
            return;

        page.SetValue(SystemTray.ProgressIndicatorProperty, progressIndicator);
    }

    public void Show()
    {
        Show(DefaultIndicatorText);
    }

    public void Show(string text)
    {
        progressIndicator.Text = text;
        progressIndicator.IsIndeterminate = true;
        progressIndicator.IsVisible = true;
    }

    public void Hide()
    {
        progressIndicator.IsIndeterminate = false;
        progressIndicator.IsVisible = false;
    }
}

The last piece of this mini-puzzle is wiring up the service to container and made it available to the rest of application:

public class AppBootstrapper : PhoneBootstrapper {
    private PhoneContainer container;

    protected override void Configure()
    {
        container = new PhoneContainer(RootFrame);
        container.Instance<IProgressService>(new ProgressService(RootFrame));

That’s all. Now declare a dependency on IProgressService whenever you need it and show/hide to give a nice feedback to the User when your application is doing something long. You never forget that User is the ultimate chief and judge in our business, right?..

,

3 Comments

Microsoft is delivering Mango, Zune wants to update my Samsung Omnia 7!

Microsoft today announced that Mango is on the way to consumer devices. I’ was quite surprised to see Zune telling me that I have an update pending. I’ve been expecting it to come later to my phone as it was with previous updates. But it looks like Microsoft tuned their update process and now it will be delivered much quicker (and I hope without bad surprises). You can watch the update wave on Where’s my phone update page on Microsoft’s site.

And if you’re waiting eagerly for this update and nothing is coming, try this trick, it helped lot’s of people to get it when Zune says it has no updates.

So, now I have an unbranded Samsung Omnia 7 device with next software parameters:

  • OS version: 7.0.7392.0
  • Firmware revision number: 2424.11.2.3
  • Hardware revision number: 3.15.0.4
  • Radio software version: 2424.11.2.2
  • Radio hardware version: 0.0.0.800
  • Bootloader version: 5.2.1.4
  • Chip SOC version: 0.36.2.0

And Zune says it has an update to 7.0.7403.0. Is it the Mango or some intermediary release? There is no way to see it unless… Let’s go!

Update log, just curios look later at the whole process and install experience

It’s 21:18, pushing Update button:

  • Download is quick
  • 21:19, Step 6 of 10: Restarting your phone…
  • 21:20, Step 7 of 10: Creating a backup…
  • 21.26, Step 8 of 10: Installing updates… (progress bar on the phone is moving)
  • 21:31, Step 9 of 10: Restarting your phone…
  • 21:31, Completed!

And right after that Zune started new update, saying it’s 7.10.7720.68. Is THIS Mango?

  • This time download takes longer…
  • 21:37, download completed
  • 21:38, Step 4 of 9: Transferring updates
  • 21.28, Step 5 of 9: Preparing to install
  • 21:40, Step 6 of 9: Restarting your phone
  • 21:42, Step 7 of 9: Installing updates (progress bar on the phone moving slowly)
  • 21:59, Step 8 of 9: Restarting your phone
  • 22:01, Step 9 of 9, Completing updates

“Checking for additional updates” – WHAT?

No, it’s finished now. It took ~45 minutes to install two updates.

Starting logo is changed, red now. Hey, it looks like I got Mango!

Software components that were updated:

  • OS version: 7.10.7720.68
  • Firmware revision number: 2424.11.8.5
  • Radio software version: 2424.11.7.2
  • Bootloader version: 5.8.1.9

So far I’m loving it.

8 Comments

Got Samsung Update for Windows Phone 7

I’ve been looking how people are getting it. But after my adventures with the latest update from Microsoft I have not been rushing getting it, just waiting quietly for delivery. It  came today.

Before installing it phone’s components where at:

  • OS version: 7.0.7392.0
  • Firmware revision number: 2424.10.10.6
  • Hardware revision number: 3.15.0.4
  • Radio software version: 2424.10.10.6
  • Radio hardware version: 0.0.0.800
  • Bootloader version: 4.10.1.9
  • Chip SOC version: 0.36.2.0

After installation (27 minutes, including backup of ~7Gb of data) I’ve got next components updated:

  • Firmware revision number: 2424.11.2.3
  • Radio software version: 2424.11.2.2
  • Bootloader version: 5.2.1.4

Works ok. Oh, the only visible change: it changed my “wallpaper” – instead of the old prison of Annecy, I got the some sand dunes. Mmm, a good reason to visit Annecy this weekend I think…

1 Comment

New day, new adventures – Samsung Omnia 7 and 7392 update for WP7

I’ve been glad to see that Microsoft started again rolling out the 7392 update for Omnia 7. We, geeks, are loving updates. It gets us more stability and new features. And bugs, sometimes…

The 7392 is a minor one, it should fix some issues with security certificates. It’s not critical, but you’ll have to install it in order to get all next updates.

When MS announced that he resumes rolling this update they also mentioned that “a small number of people … might have trouble …”. By Murphy’s law I’ve landed in that small group that’s having troubles. How it was:

  • Zune said it has an update for my phone.
  • Zune is trying to install update but can’t move past “rebooting” stage. No probs, Microsoft warned about it an provided a workaround.
  • Installed the tool from Samsung, following instructions how to enter the phone in Download Mode.
  • The phone is not entering in Download Mode, so Samsung’s tool cannot update the firmware so then Zune can install 7392 update.
  • The only option to be tried is, as suggested by the tool and MS’s guide, is to contact Samsung Service Center.

After googling around I’ve found that Omnia 7 phones with bootloader version 4.10.1.9 cannot enter in Download Mode by pressing VOLUMEUP + CAMERA keys. It’s disabled in this version.

Looking further I’ve found that I have 2 options to get this update (and, consequently all next updates that will be rolled from now on):

  • Contact Samsung’s Service Center. The recommended way. This probably will mean that you have to send your phone somewhere in order to get it serviced. Will call them to see how much time will take that, but looks it’s not an option for me.
  • Tweak the hardware to enter Download Mode. The phones that can’t enter this mode by with known key combination can be forced to to it using a special (modified) PC connection cable or a Mini-USB dongle attached to the phone. Search Ebay for “Samsung Galaxy S Download Mode USB jig”, you’ll get the idea. 8$ + shipping. Plugging in this dongle will set the phone to Download Mode and you’ll be able to run Samsung’s utility to update the phone. Or you’ll be able to flash a new ROM for device. See Omnia 7 wiki on xds-developers for details about phone and flashing.

Second options isn’t a recommended way to do it. You can kill your phone. Do it at your own risk. But most probably that’s what I’ll be trying to do, because I don’t have any willing to send my phone to a service center even for few days let alone for few weeks.

Update 01/06/2011:

As I’ve received today the USB jig that I’ve mentioned earlier, this is the follow up.

Switched phone off, plugged in the jig & wait for Download Mode to appear on the screen, pulled it out then connected to the PC. Samsung’s tool detected the phone and offered to update my firmware. Less than a minute later it congratulates with a successful update and rebooted the phone.

After reboot Zune started and offered to install the 7.0.7392 update. Accepted.

It passed successfully the glorious “rebooting” stage and after doing the backup my phone was successfully updated to latest Windows Phone OS. Now waiting for Mango…

7 Comments

MIX11 day two, Windows Phone 7 announcements

I’ve bee watching Channel 9 with WP7 announcements and there are very interesting things that are coming to the platform, both developer and end-user oriented. In no particular order, with my comments:

  • Jump list (on letters using LongListSelector) and app search directly in application list. It’s a welcome change. When number of installed apps is past of 30-40, it’s very hard to find quickly the right app. I’ve tried to imagine a solution for this problem and came to idea that MS will let user’s create “folder” tiles to group apps, similarly to iOS. How will work solution from MS we’ll see when Mango will be released.
  • Marketplace improvements and better search. Another much welcomed change. Whenever I had to find something in Marketplace I would rather fire up Zune if it’s available. Same, Games Hub is nice addition.
  • Third party apps integrated in search.
  • Improved hardware interoperability. Camera, gyro, compass. I’m cool for this stuff.
  • Improved live tiles. You can “pin” part of your apps to a tile. Extremely powerful feature, if done right (by developer). Then you have animations and status updates on a tile, directly from the app and not a remote service.
  • MULTITASKING. I’ve been waiting for it. “Only back” navigation isn’t the greatest experience when you’re trying to do few things at the same time. App switching speed is very impressive. I’ve seen demos of Blackberry’s PlayBook based on QNX and running few resource heavy games at once and I’ve beed astounded by how system manages that. I’m glad to see that WP7 offers similar experience.
  • Sockets & low level network API. Skype is coming. Hope to see a decent IM app supporting ICQ & GTalk soon. And a VoIP/Softphone client too…
  • SQL CE database. Good to have, may be useful for data intensive apps & offline capabilities.
  • IE9 & HTML5.

So, Microsoft took a slow start strategy with Windows Phone 7. Got it out robust but low on features if compared with iOS & Android. Made first update (the NoDo) to make small improvements and polish the update process itself. And Mango will be coming this year to put it on par with competitors. When you add to the game the power of Microsoft’s marketing machine, strong partner relationships and Nokia deal, then forecasts about WP7 getting over iPhone by 2015 sound very realistic.

1 Comment

Installed NoDo update on my Samsung Omnia 7

Almost all Windows Phone 7 enthusiasts were waiting for first serious update for the platform, the NoDo. When I’ve seen first posts coming in my RSS stream that people started getting the NoDo from Microsoft I’ve plugged my phone to PC without too much hope. Pre-NoDo update came up in my Zune few days later than for other people.

Not this time. Zune popped up with new update. After a bit of hesitation (remember the pre-NoDo that went bad for some Samsung phones and even bricked a few?) and receiving encouragements in Twitter I’ve pushed the “Update now” button. I’ve logged it to my twitter @vcaraulean.

Times and steps:

  • 21:50 start!
  • 21:51 2 of 10, downloading
  • 21:51 5 of 10, preparing to install
  • 21:52 6 of 10, rebooting
  • 21:52 7 of 10, creating backup
  • 22:00 8 of 10, Installing updates, please wait…
  • 22:10 9 of 10, rebooting
  • 22:11 completed!

OS version: 7.0.7390.0

So, entire process took 21 minutes including backup of ~4GB worth of pictures and videos. And it went flawless

My first impressions (subjective, of course) on running wp7 after NoDo:

  • Applications are launching faster. Cudos to MS for this one. In one of my tweets I’ve compared it with a change from traditional HDD to an SSD drive, it feels very similar.
  • Long list are scrolling smoother (in my apps, at least)
  • Using phone is even smoother experience than before: less rough edges, faster touch feedback, fluid transitions
  • Copy & Paste. Another famous part of update. Lot’s of pros and cons on this feature. But everyone will get ‘Copy’ icons popping up when taping a word in browser. And it works…

Now waiting for “Mango” update to bring new cool features (not-really-but-alike multitasking) and hope NoDo will bring no bad surprises in the long run.

Who is waiting for the update to arrive, Microsoft offered details on what is delivery state of NoDo for major mobile operators: International operators, USA operators.

Update:

For hacker souls who never mind exploring shadow areas, you can try get the update on your phones faster than others:

You’ll be doing it on your own risk. If you brick you’re phone it’s your responsibility. Good luck!

16 Comments

How we get inspiration…

That’s interesting to observe how we’re getting influenced by things around us. How world we see and experience is determining what and how we do. Most of the time we’re not sensing the source of our actions and decisions. It’s very subtle. And often the “it feels right” moments are a sign that experience we’ve got, processed and incorporated is applied without realizing what exactly is done right…

But not this case:

image

I’m working on Windows Phone 7 application (yes, mGitHub and btw it’s already available in marketplace) in my spare time and weekends and I own a WP7 device which I really like. So, there was no surprise when I’ve seen that Metro UI, the visual style of Windows Phone 7 platform, influenced me and leaked in this screen that is part of a Silverlight application.

Asked people what they think, got mostly positive appreciations. It would be interesting to see how this concept will evolve. It’s only an early sketch, done by a “more developer than designer”. How you like it?

Leave a Comment

mGitHub Sample Application. Using Caliburn.Micro to build Windows Phone 7 applications

* mGitHub.SampleApp on GitHub

** mGitHub – the real app – is available in Marketplace

The story

I’ve been very excited when Microsoft announced a new & shiny mobile platform, the Windows Phone 7. Mostly because it gave me the chance to explore new things using very familiar tools: Visual Studio 2010, C# and Silverlight. I never had enough time to start digging in this area. When I’ve read that Rob Eisenberg announced a Caliburn.Micro contest and having lost the passion for doing my job at company I’m working now, I’ve decided to participate.

I’ve decided to go with an interesting idea – writing a WP7 app to work with GitHub. Mainly because I’m sure that I will use such app myself. GitHub is an awesome service that lets you host and collaborate on your projects freely once they are open source or if you want private projects you can have it too for a fee. I like idea and this sample application so much, the whole development process went so smooth and easy so that I’ve decided, along with participation in CM contest and publishing sources of my sample app on GitHub, to continue developing it by adding more features to offer a complete and user friendly application to work with GitHub (later about this).

The app

mGitHub.SampleApp allows to browse few preselected projects and repositories on GitHub. You can see user/repository details, navigate trough user’s own repositories, watched repositories, view contributors and so on…

The use of Caliburn.Micro, which is (not only) a MVVM framework, implies that application is View Model driven. Main screen is baked by a view model, then everything else – application flow, user interactions, service calls are done within View Model classes (with few small inclusions of WP7 navigation model, view based).

WP7 controls like Panorama and Pivot were also used with MVVM in mind. For example, here is the code for main View Model that is serving a Panorama-based view:

public class MainPageViewModel : Screen {
    public MainPageViewModel(MostViewedViewModel mostViewed,
                             FavoritesViewModel favorites,
                             AboutViewModel about)
    {
        MostViewed = mostViewed;
        Favorites = favorites;
        About = about;
    }

    public FavoritesViewModel Favorites { get; protected set; }
    public MostViewedViewModel MostViewed { get; protected set; }
    public AboutViewModel About { get; protected set; }
}

So, here we’re just injecting our View Models for individual Panorama pages in MainPageViewModel and then SimpleContainer takes care to provide required instances. Since in a Panorama control all pages are visible (active), we’re using a simple Screen (from CM) as our base class for our VM. Then, this is how the panorama view is defined:

        <controls:Panorama Title="mGitHub sample app "> <controls:Panorama.Background> <ImageBrush ImageSource="PanoramaBackground.jpg"/> </controls:Panorama.Background> <controls:PanoramaItem x:Name="Favorites" Header="my favorites" /> <controls:PanoramaItem x:Name="MostViewed" Header="interesting" /> <controls:PanoramaItem x:Name="About" Header="about" /> </controls:Panorama> 

It’s nice and clean, with very good separation of concerns: each panorama page has it’s own View and a corresponding View Model. The work to glue it together is done by Caliburn.

The Pivot is a bit different. This control is basically a well known TabControl, it has headers and only one item is active at a time. For a PivotViewModel we’ll use a Conductor class with one active item:

[SurviveTombstone]
public class PivotViewModel : Conductor<IScreen>.Collection.OneActive {
}

Then the two application Pivots, UserPivotViewModel and RepositoryPivotViewModel will just ask from container the view models of individual pages and add them to Items collection of Conductor class:

[SurviveTombstone]
public class UserPivotViewModel : PivotViewModel {
    private readonly UserDetailsViewModel details;
    private readonly UserRepositoriesViewModel repositoriesViewModel;
    private readonly UserWatchingViewModel watchingViewModel;

    public UserPivotViewModel(UserDetailsViewModel details,
                              UserRepositoriesViewModel repositoriesViewModel,
                              UserWatchingViewModel watchingViewModel)
    {
        this.details = details;
        this.repositoriesViewModel = repositoriesViewModel;
        this.watchingViewModel = watchingViewModel;
    }
    protected override void OnInitialize()
    {
        base.OnInitialize();

        Items.Add(details);
        Items.Add(repositoriesViewModel);
        Items.Add(watchingViewModel);

        ActivateItem(details);
    }

The view, again, is very simple, grace of Caliburn.Micro magic:

        <controls:Pivot x:Name="Items" Title="{Binding PivotTitle}" SelectedItem="{Binding ActiveItem, Mode=TwoWay}"> <controls:Pivot.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding DisplayName}" /> </DataTemplate> </controls:Pivot.HeaderTemplate> </controls:Pivot> 

That’s why I enjoy using this framework, it makes some development tasks extremely simple.

Also, application make use of INavigationService,  wrapper API for Launchers/Choosers and is aware of Thombstoning. I tried to keepcode small enough to be easily followed and read, so it will not be too hard to find those places in project’s source code…

Another (probably interesting) piece of code in this project is communication with GitHub using their API. It’s not exactly the IGitHubHost service that I want to highlight, it’s pretty trivial. Take a look at two wrappers around RequestProcessor class, both added in order to improve User Experience when working with mGitHub.SampleApp on the phone:

  • ProgressAwareRequestProcessor – will show a view with PerformanceProgressBar during any remote call
  • CachingRequestProcessor – providing a extremely simplistic data cache, storing requests and their results

These wrappers are registered in container and View Models even don’t know about their abilities, for them it’s just issuing a call and displaying a result. Separation of concerns is always good principle to follow…

Screenshots

Few screenshots, to get the sense of how UI looks like:

12

34

 

Final notes

This application surely contains bugs, it probably has few strange design decisions and graphics are done by professional developer (me). But it works. It serves it’s main purpose to show how you can write an application for Windows Phone 7 using Caliburn.Micro. And I had a lot of fun working on it…

I’ll surely improve this sample, fix reported bugs and will listen carefully to improvement ideas. So, any feedback is welcome.

But in the meantime, I’m doing everything possible to release a real application to Marketplace that will be called mGitHub and will offer essentially improved experience and more features. So, if you like the idea, if you like GitHub and will most likely use the app on your phone, I would be glad to hear from you. Next time when I’ll be planning features your feedback will be considered.

This application weren’t tested on a real phone. I’m counting the hours until my hands will get the ordered Samsung Omnia 7 and I’ll be testing this app on real hardware. If everything goes well, expect yearly next week a feedback (and probably fixes & improvements) after using the app on WP7 device.

Code of this application is licensed under MIT license and available on GitHub.

Credits

Thanks to:

Special thanks to:

  • my friend Dumitru Cantemir for helping me with some code.
  • my daughter, for letting her dad working on this app. Even if sometimes it was …

DadAtWork

3 Comments

Perceived performance

I’m watching a recording of Windows Phone Design Days, it’s the part about “perceived performance” with Jaime Rodriguez. He put up a nice table with response times and recommended visual feedback. I’ve seen these recommendations before. I’ve talked about these recommendations with my team. I’m insisting applying them every time when I see in out apps that an action has no visual response within one second after triggering it.

Even if it’s talking in context of User Experience on Windows Phone, I think these numbers are a formal guidance for good user experience on every device, modern gadget or software application.

I’ll make a copy of this table here, just to keep it in a handy place for further reference. It’s so well worth keeping it…

system response time duration recommended feedback
instantaneous response bellow 100 milliseconds built in common controls
immediate response between  500 milliseconds and 1 second built in common controls
vers short wait 2 seconds or less built in common controls
short wait 2 to 5 seconds progress bars
moderate wait 5 to 10 seconds progress bar with details like percentage completition or time remaining
long wait 10 seconds or greater progress bar with details of sub steps. Allow user to move to other tasks
continuous feedback long process progress bar with details of sub steps. Allow user to move to other tasks

Read, remember, apply!

1 Comment

Follow

Get every new post delivered to your Inbox.