Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Friday, 5 June 2015

Windows Phone 10 - First Impressions

After running the Windows 10 Technical Preview on my laptop for the last few months and being generally happy with it, bar the obvious problems you get running a Technical Preview, I've been itching to get my hands on Windows Phone 10 (officially referred to as Windows 10 Mobile, but I'm going to refer to it as WP10). As a very happy owner of a Lumia 1020, I'll be getting it eventually so thought it was worth taking a look at. Fortunately, a colleague has recently switched from WP to Apple, so he kindly leant me his Lumia 635 to use as a sacrifice to the Technical Preview gods.

If you want to run the Technical Preview, details are here. But seriously, heed Microsoft's warning. You don't want to apply this to your main phone. I haven't hit any bugs yet, but the many interaction problems mean I'd be really annoyed if I had installed this on my main phone.

The Good

The settings app is vastly improved over the one on WP8.1, which is essentially a load of very narrowly scoped categories in a really long list on the page. The new app is well thought out, and the categorisations seem to broadly match those on Windows 10 on the desktop, which means you experience with one should transfer pretty well to the other.



The quick access to commonly used settings that has appeared in the notifications flyout on Windows 10 is also present here. It's a welcome addition that should reduce the need to venture in to the Settings app.







The Bad

Yes, that good section whizzed by rather fast didn't it? While I generally like Windows 10, even though it does remove some of the minor features of Windows 8.1 that I quite like, WP10 takes this a step further and removes pretty much everything I like about WP in one fell swoop. Let's go through the list shall we?

Command placement

WP was very predictable, all commands were at the bottom of the screen, easily reached by your thumb to summon them up. They were large and full width, so you could easily trigger them with the hand that is holding the phone without too much stretching. The overall one-handed experience with WP8.1 is very comfortable.
A great deal of the commands seem to have moved to the new "hamburger" menus in WP10, which are situated in the top-left, about as far away from your phone-holding hand as you can get (unless you're left handed of course).

Top, bottom, ellipsis,
where do I go?

Swiping

As part of their march to look like everyone else, MS have removed the pivot control from their apps. This means that instead of just swiping, again with your phone-holding hand, to move between screens, you now have to stretch
to either the hamburger menu or, in the case of the dialer, to the buttons situated in the middle-top of the screen OR the buttons situated in the middle-bottom of the screen. Add to that, the dialer still has the older ellipsis menu from WP8.1, this one app has about every interaction model available, except for the one that suited it the most. Now I'm sure the ellipsis will go before release, but MS seem to have lost sight of the fact that the Pivot control was one of the greatest things about WP8.1 and I can't help but think that they could've got away with just making it a little smaller to make things more familiar to Android/iOS users while still retaining the superior interaction.








Schizophrenic navigation in the UWP mail app.

I've noted this separately from the above as I genuinely don't know whether this is just because this is a TP or if this is how this is actually intended to work, but the interaction with the mail app is incredibly painful and I sincerely hope this is not a sign of what we can expect from the UWP platform. I generally don't like doing 1-to-1 comparisons against a preview build, but in this case it's necessary to show how much of backward step this is.

To look at account settings in WP 8 is: Swipe up (or tap ellipsis) to bring up command bar (at the bottom of the screen), tap settings in the resulting menu which appears from the bottom of the screen.

In WP10: Tap hamburger (top-left), cog icon (bottom-right), tap options (in menu that appears from top of screen). My finger is going all over the phone here. It's quite a stretch and it's not even a big phone. On my Lumia 1020, I suspect this would be a 2-handed operation.




Ready to dropdown and
nowhere to go.

Desktop input controls on a phone

Most of the criticism aimed at Windows 8 is that it uses a phone UI on the desktop. It would appear misplaced UI elements is a two-way street. In the calendar app, and presumably all UWP apps, the dropdowns, rather than being full screen as they have been previously, are dropdowns just as they would be on the desktop. Except now they've got to contend with fat fingers and an on-screen keyboard that giv
es them no vertical height to occupy.




Slow animation on apps view

Now I'm nitpicking a bit, but WP at the moment is a very snappy, fast OS. You can get things done pretty quickly and there are no slow animations getting in your way, everything happens almost instantaneously. Long pressing on the back button to bring up the running apps view triggers in what feels like about 100-200ms and the animation is quick.
On WP10, it feels more like 700-800ms and the animation is slow. I don't think this is down to the hardware as there is no visible lag, it just seems that they've slowed it down to make it smoother. Smooth === slow in this case.

Verdict

Not good. WP has always been a very different beast to other mobile operating systems, maybe this is part of the reason it hasn't taken off. But, in my view, the interaction with WP is faster, easier, and more natural than interacting with Android or iOS. I haven't had a great deal of contact with iOS and even less with BlackBerry, but I had Android phones for about 6 years before my current Lumia and while I didn't hate using them, WP was the first mobile operating system that I can actually describe as being pleasant to use.
 While there are a lot less WP users, those who stick with it tend to be much more satisfied with it than users of other operating systems. This survey, while admittedly a couple of years old, proves the point (at least among the users Reader's Choice surveyed).

 In their attempts to try and appeal to Android and iOS users, MS seem to have forgotten the things that make WP so pleasant to use. While I do not blame them at all for trying to make the experience more familiar to users of other OSes so the move doesn't seem quite so scary to those used to Android or iOS, you've got to think of your existing users while trying to appeal to new ones.

I suspect that, if the current preview is anything to go by, WP10 is just going to look like a pale imitation of Android or iOS, and that's a damn shame.

Wednesday, 15 April 2015

Close a window by title in C#

When you're developing for embedded systems that don't have a mouse or keyboard attached, a misbehaving program that decides to pop up windows at random is suddenly a lot more inconvenient.

Cue the below code snippet, which takes in a window title and sets it's state to minimised, maximised, or normal depending on the parameters you pass in. As usual, this is a Linqpad script. You just need to add a reference to System.Runtime.InteropServices, which is part of .net 4 and above.


void Main()
{
 var windowTitle = "Untitled - Notepad";

  IntPtr hWnd = FindWindow(null, windowTitle);
    if (!hWnd.Equals(IntPtr.Zero))
    {
        ShowWindowAsync(hWnd, SW_SHOWMINIMIZED);
    }
 
}

// Define other methods and classes here
private const int SW_SHOWNORMAL = 1;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWMAXIMIZED = 3;

[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);

[DllImport("user32.dll", EntryPoint = "FindWindow")]
private static extern IntPtr FindWindow(string lp1, string lp2);

This just imports the FindWindow and ShowWindowAsync methods from the user32 assembly. FindWindow is used to find the window we want to close. This return a pointer to the window handle, which we then pass to ShowWindowAsync along with an int indicating what we want to do to the window.

In the above example, I already know the window title, but this is unlikely to be the case in the real world. You can get this with the below snippet which will select out the window title and the process name. You can obviously add a where clause and modify the results based on your needs.

Process.GetProcesses().Select (p => new{p.ProcessName, p.MainWindowTitle})

Tuesday, 23 April 2013

Breathing new life in to old netbooks

You don't see many netbooks around these days, and for a very good reason. When they were new, their performance ranged from ok to rubbish and they were no good for any real computing. Looking back, they were more like the first stab at the sweet spot between a smart phone and a full-on laptop/desktop, a gap which has been much more successfully filled with tablets in recent years.

I have 2 netbooks, one is a Samsung NC10 and the other a Dell Mini 9. Both of these have an Intel Atom N270 @1.60 Ghz and 1GB of RAM.
The Dell ran XP (badly) and the Samsung has run XP (badly), Windows 7 (really badly), and Ubuntu (just about acceptable).

When Windows 8 was released, one of the things that I noticed the most was the very noticeable improvements in general performance. Some of this was clearly down to the removal of superfluous effects but that could not explain all of the improvement

Just after Windows 8 came out, I installed it on the Dell. Performance was much better than I expected, better than XP. The Dell's odd screen size meant some hacking to get the screen in to 1024x768, even then there is a small amount of blur. It works okay for some basic note taking and browsing, but I wouldn't stress it with anything further.

Recently, the other half graduated to using an ASUS MemoPad for her needs, leaving the Dell spare. I decided to install Windows 8 on this too and, surprisingly considering it has exactly the same processor and amount of ram as the Dell, it performs even better. Haven't put Office on yet so it could still go downhill, but so far I am very impressed.

So if you've got some old netbooks lying around that you had written off as being useless for anything, throw Windows 8 on them you may be surprised at how nippy they are as a result.

Tuesday, 1 January 2013

My experience of Windows 8

I think it's fair to say that Windows 8 has been the most controversial and negatively received OS since Vista. Every mention of Windows 8 invokes cries about the Metro UI and how the OS is a schizophrenic nightmare. Occasionally, amongst these voices will be a quiet statement of "it's not that bad once you get used to it".

That little voice isn't far wrong.

That's not to say that after using Windows 8 for a while that I have grown to love the Metro UI and think it's the best thing since sliced bread. No, it's just that I've learned to ignore it to the extent that I barely notice it is there.
Worth noting that, despite it allegedly only being a code name, I will be using the term Metro repeatedly in this post, it's just easier to type than Windows 8 Store app.

Start screen

It wasn't until I had used Windows 8 for a few weeks that I realized how little I used the old Start Menu. Since the ability to pin applications to the taskbar was added in Windows 7 and the addition of a fantastic little application called Bins which allows me to have 4 apps in one 'slot' of the taskbar, everything I need is in the taskbar. This relegates the Start Menu to two things - Search and shutdown.

Search

One thing that Microsoft have gotten right in Windows 8 is the search experience, which is superior to that of previous Windows versions. I get a big full page list of search results which covers files, settings, and applications and also the ability to search things like eBay from the same screen (not a feature I see myself using, but a nice touch anyway).

Shutdown

Shutdown/Restart is the biggest thing that has frustrated me about Windows 8. There are a couple of ways to do it:
1. When using a mouse, hover the mouse over a mystical hotspot in the bottom right hand corner, click on Settings, click on power, and then select from shutdown/restart/update. This is such a massive pain in the ass when using a mouse that it is not even really an option.
2. Same as above but the charm bar is invoked using Win+C instead of the mystical hotspot.
3. Alt + F4 when on the Desktop - the preferred option and not a problem for a keyboard/mouse user, but absolutely impossible if you were using a tablet, which is supposed to be Metro's Raison d'ĂȘtre.
 My wife, who is fairly technically literate, could not figure out how to turn it off. I had to Google it, expecting that there would be some ridiculously easy method that I was completely overlooking. There was not. In order to make things easy for myself, I have added a shortcut to shutdown.exe on the Metro start screen so I have the options of one-click shutdown if I'm in Metro or Alt+F4 if I'm in classic desktop. Can't see your average Joe user coming up with this solution though and this will be one of the biggest transition headaches in my opinion.

Metro applications

The other biggest issue with Windows 8 is Metro apps. I work with Windows and C# on a daily basis and I must admit that I have found it really difficult trying to work with Windows' new paradigm. Local database usage is incredibly difficult, with portable libraries not allowing you to use some of the standard data libraries. Microsoft has tried really hard with their samples, but some of them fall short, such as the settings sample which shows how to use the settings flyout but does not show how to retrieve or save settings the "Metro" way.
 The expectation is very much that Metro apps will be consuming cloud data sources and so will not need local database access. But cloud does not work for everything, such as business applications or little apps I write to make my life easier. Microsoft have limited the usefulness of Metro apps by not doing the extra leg work to make the development experience equal or superior to writings a standard Windows app. For something so radical to be picked up, they need to make the community want to use it, not try to force them to do it a certain way and remove the tools they are used to using unnecessarily.

From my perspective, I have almost completely ignored the Metro apps as the vast majority are useless to me. I suspect that, unless major improvements are made to the support for standard .net libraries in Windows apps, that Metro apps will be relegated to time-killing games and media consumption, something that the Metro UI is perfect for.

Those are the biggest issues Windows 8 has which, for your average user, are absolutely massive hurdles to overcome and is the reason many businesses will be completely skipping Windows 8 and hoping that a future service pack or Windows 9 corrects some of Windows 8's mistakes.

But of the 3 main issues described above (Start screen, shutdown, Metro apps), 2 are largely ignorable and the other is easily worked around.

But it's not all bad...

Those not withstanding, Windows 8 has some plus points.

Upgrade experience

I upgraded from Windows 98 to ME, and regretted it for weeks after until I finally bit the bullet and did a complete reinstall. The upgrade experience from Windows 7 to 8 was as smooth as it could be. The upgrade adviser told me which applications would be incompatible ahead of time and uninstalled them for me as part of the upgrade, the upgrade itself was paid for without ever leaving the upgrade application.
Post-upgrade, everything worked and the only issue I have had is Linqpad not showing up as an installed application in the search screen which was easily solved by a quick re-install.

Faster than Windows 7

 Owing largely to the removal of superfluous visual effects but I suspect there has also been some serious optimization work done under the hood. The improved Task Manager is also a nice touch.

Hyper-V built in

 I haven't made massive use of this yet owing to having an almost-1 year old in the house and generally having less time to tinker than I used to, but when I have done some work requiring a VM, it has been more than adequate. My virtual server hasn't been fired up in almost a year now.

Great upgrade offer

I haven't paid for a Microsoft OS in a very long time, apart from as part of a new machine purchase. Despite the controversy over Windows 8, the cheap upgrade price of £15 and the possibility of being able to write applications and publish them through a store that would gain my applications exposure and possibly even make me a few quid, was enough for me to bite. The ecosystem possibility seems a little less likely now, but I still think the upgrade was worth it.