It’s a Laptop but not as we know it

What’s a ChromeBook

Acer C720 on the trainSo it’s day one with my new ChromeBook. I’ve never used one before and bought it on the recommendation of some fanboys I heard raving about them on a podcast. My old netbook, a poor little thing, had been running the now expired XP. I’d been looking around for an alternative Operating System (OS) to install to try to extend the netbook’s life. I eventually installed one called Peppermint, which is a really great OS optimised for netbooks. And it worked great apart from the slight problem that the netbook’s processor is so slow. It ran like a dog. A dog with one leg. So then I started investigating these ChromeBooks. Very affordable laptops that run a very efficient OS on humble hardware. Their entire purpose is to run (pretty much) just Google’s Chrome browser as smoothly as possible – without all the complications of a Window’s computer.

Why Not Windows?

Windows is a big, heavy OS that must support lots of different programs and devices and peripherals. It has the burden of having to continue to run software written tens of years ago. It needs constantly updating and fixing, and needs protection from viruses and spyware. Would you like to update Java? And because it’s so heavy, you need faster processors to run it, and more memory, and more electricity – and so shorter battery life on laptops (or heavier, bigger batteries). And the processors get hot and fans are blowing and my lap is getting burned whilst I’m being deafened. Now I’m one of the seemingly few people that actually likes Windows 8, and I have a nice big machine to run it on. And it runs great. But when it comes to surfing the web from the sofa, I just don’t need it. Or the tray to protect my lap.

First Impressions of my Acer C720

“But it looks just like a laptop…” said a friend of mine.

OK, so what have I found.

  • The Chrome browser is excellent! It truly is desktop quality, as claimed.
  • And it’s fast. Using the browser really is very fast.
  • Two finger scrolling is cool.
  • There are many apps, although still discovering them.
  • The C720 has a nice keyboard
  • and a good screen.
  • It starts up faster than I can open it and put my hands on the keyboard.
  • There are many guides online with hints and tips of how to use a Chromebook.
  • There are lots of keyboard shortcuts which is great for productivity (press ctrl-alt-? on the device for a guide!).

Written with StackEdit, on the ChromeBook, of course :-)

Blogging on the Train

I am looking to update my blog from the train on my daily commute. The main hurdle to overcome is the fact that the computer will not be connected to the internet during this time. And so the hunt for a decent offline blog editor begins.

The obvious place to start is Windows Live Writer.

I need to find out how to post source code using it. Apparently there is a plug in.

Watch this space.

Mono for Android: Just too expensive

There has been much talk in the office about mobile development.

I work with several devs that are building mobile apps in various different techs on different platforms.

For ages, I’ve been flying the Xamarin flag and fighting its corner. I’ve got the guys to come to Stuart Lodge’s MVVM Cross talks etc. As a development environment, I like it very much and I’m comfortable. I’m a c# WPF developer and so I like C# and Visual Studio.

But with the new pricing, I feel as though I’ve been let down.

$1000 is just way too high for the hobbiest app developer. Not to mention that that is per dev, so the guys that are in a small team of 3 or 4 – is their app going to make back $4000? Not any time soon that’s for sure.

And so they are going the Javascript, Typescript, Angular etc route under PhoneGap or whatever. And I don’t blame them.

Meanwhile, I’ve 11 months left of my annual subscription to build something in Mono for Android before the $1000 bill comes around again. And I feel I’ll have a hard time justifying it.

Common UI? Spotify on WP8 != Spotify on Android

Welcome Spotify!

Several friends of mine have the beautiful Nokia 920 running Windows Phone 8. It is a nice piece of hardware and it showcases WP8 very nicely.

One notable omission from the WP app store until now has been Spotify.

I’ve been a big supporter of Spotify ever since the beginning and happily pay my monthly premium subscription. Being able to store music offline on my phone is an absolute killer feature.

And so I am genuinely pleased that it has made it to the WP platform.

A Common UI

A hot topic of recent conversation amongst the boys has been HTML5 and the possibility of a common UI across multiple platforms. The conversation typically includes:

“You can write it once and it’ll run on desktops, iPads, mobiles…”

I have been developing in Mono for Android which allows for the code from the “viewmodel” (a logical representation of the view), interaction and business logic, service calls, etc to be shared.

Crucially though, the view, the UI, is not shared. And I believe this is a good strategy.

Users of Android expect their apps to be Android-like. Ditto for iDevices and Windows Phone.

Looking at screenshots of the new WP8 Spotify app, it is clear that the UI has been redesigned specifically for the Windows Phone. And rightly so.

So I applaud Spotify for making this (what I believe to be the) correct decision.

 

http://blogs.windows.com/windows_phone/b/windowsphone/archive/2013/02/08/spotify-arrives-on-windows-phone-8.aspx

Pausable Observable

There are many times when we might need to “pause” a live stream of data.

For example, your app is receiving live updates to a screen and then the user opens some sort of popup. We might choose to pause the live updates until the popup is closed. Once the popup closes, we need to apply the updates that have arrived in the mean time.

Often, it isn’t possible to actually pause the source of the data, such as a server. We also wouldn’t want to unsubscribe temporarily because updates could be missed.

Here is an extension method that takes an RX stream and makes it pausable. It is controlled by an observable which indicates whether the stream is paused or not. Updates are buffered whilst the stream is paused. When the stream is unpaused, buffered updates are pumped.

PausableObservable: https://gist.github.com/4317938
Unit tests: https://gist.github.com/4317948

public static IObservable<T> Pausable<T>(
           this IObservable<T> sourceStream,
           IObservable<bool> isPausedStream,
           bool startPaused = false)
        {
            return Observable.Create<T>(o =>
            {
                var subscriptions = new SerialDisposable();
                var replaySubjects = new SerialDisposable();
 
                var subscription = sourceStream.Publish(stream =>
                {
                    Func<ReplaySubject<T>> replaySubjectFactory = () =>
                    {
                        var rs = new ReplaySubject<T>();
 
                        replaySubjects.Disposable = rs;
                        subscriptions.Disposable = stream.Subscribe(rs);
 
                        return rs;
                    };
 
                    var replaySubject = replaySubjectFactory();
 
                    Func<bool, IObservable<T>> switcher = isPaused =>
                    {
                        if (isPaused)
                        {
                            replaySubject = replaySubjectFactory();
 
                            return Observable.Empty<T>();
                        }
                        else
                        {
                            return replaySubject.Concat(stream);
                        }
                    };
 
                    return isPausedStream
                        .StartWith(startPaused)
                        .DistinctUntilChanged()
                        .Select(switcher)
                        .Switch();
                }).Subscribe(o);
 
                return new CompositeDisposable(subscription, subscriptions);
            });
        }

This is based on an answer to a question on StackOverflow. However, there was a small issue which I had to fix – and I also needed to be able to specify in which state the pausable stream started.