Simple Debugging in Xamarin Forms

Text labels in your XAML can be given a name. And that name can be referenced in the code behind. First create a label in your XAML. Stick it in the content page and not in ToolbarItems as there isn’t enough space there really. I usually give that label a silly name that’s completely disassociated with the topic of the app I’m writing, so that it stands out when I want to find it and comment it out.

<Label x:Name="banana" Text=“”/>

Now you can reference this label in the code behind. Say for example you have a string variable called CloudType. What I find useful is to state the name of the variable, and then the values held in the variable.

banana.Text = "CloudType: " + CloudType;

Or if you’ve you’ve got a variable that’s not a string, say CloudHeight is an int, then you can tag a ToString on the end

banana.Text = "CloudHeight: " + CloudHeight.ToString();

Probably not the most elegant or best practice way to debug your code. But it’s a quick and easy way of trapping bugs


Make a good cup of coffee

Here’s an easy (and cheap) way to make good coffee every time, without spending a lot of money. The secret isn’t lots of expensive machines, but good ingredients that you can measure. Find the right recipe, then you can make and remake it every single time. And to make that easier, I’ve written an app. As an example of dong this on a budget, I get by with the following:

The key is to weigh the coffee (before you grind it) because coarse ground coffee takes up more space than fine ground coffee. So you can’t go with volume.

Then measure the water.

Then make the coffee.

Now depending on whether you’re making a drip coffee or an Infusion coffee (like a french press) will depend on how much coffee / water you’ll need. And whether you want a regular or strong cup of coffee. So I made an app to help me get it right. Nothing fancy but it’s made my daily coffee a lot better. You can get it on iOS or Android

There’s lots of ways you can improve this. Grinding your coffee beans fresh will get a better cup of coffee. Then upgrading to a burr grinder instead of a blade grinder will get another level of improvement. But then it’s starting to get expensive and that increasing cost might be difficult to justify for the improvement in taste. (I deliberately took pictures of my basic equipment in a small part of my kitchen to show you don’t need a big fancy setup to get a good repeatable system going).

For me, just moving to filtered water, and then measuring the coffee to water ratio made a big difference. It’s infinitely better than any kind of instant coffee. It’s better than the capsule based coffee machines I used to have. It’s better than just standard filtered coffee because I can tell when it’s too bitter and make adjustments. Using the app made it easier for me. Hopefully someone else will find it useful too.


A Philosophical Debate on an OS?

Chatting with one of our Solution Architects yesterday and I saw an Apple watch on his wrist.  Amused I pointed out that I had my Moto 360 and we were living in a Dick Tracy future.

“I’m sure we could have a philosophical debate over this” he said, referring to our different mobile OS affiliation.

An interesting choice of words

Philosophy according to Wikipedia is ” the study of general and fundamental problems, such as those connected with reality, existence, knowledge, values, reason, mind and language”  and as a method, “philosophy is often distinguished from other ways of addressing such problems by its questioning, critical, generally systematic approach and its reliance onrational argument

Rational argument where iOS and Android fanboys are concerned is a level of hilarity on it’s own. However I do think there’s something in there around the two operating system approaches and what it is about them that appeals to different people.

Android for the most part shows it’s heritage in the Linux and open source world.

iOS is a platform from a company with a history of selling boxed software and hardware products.

Those origins have a core input into the design approach of the operating system, how users interact with the product and the overall experience of the device.  I’ve pulled out a few interesting points and it’s not an exhaustive list.  But I think they go to illustrate some of the key differences between the OS that reflects the vision that each organisation has for it’s product.


Android  Apple iOS
 It’s relatively open and users can install the applications they choose.  This is great for hippies  Software access is strictly controlled and locked down to vendor approved apps.  From a security perspective the iOS platform has strong encryption, better built in two-factor authentication in the hardware and an operating system and application eco-system that provides fewer attack vectors

A common critique of iOS from the Android camp is it’s locked down walled garden approach.  This isn’t necessarily a bad thing though.  Assuming that you trust Apple (and objectively there’s little reason to trust them any less than you would Google or Microsoft), then they are providing a layer of control over your device that is impossible to replicate on Android.  The iPhone is a product from Apple comprising a hardware model and an operating system.  The two are intrinsically linked.  Android is an operating system licensed by many vendors and then tweaked by carriers.  So when a major security flaw hits, Google can patch it’s OS, but then the hardware vendor has to patch their version of Android, and then the carrier has to patch their version of that version.

So whilst Android is providing a greater level of freedom for the user, it’s also providing a greater level of freedom for anyone trying to break into your phone.  Now that Android is the most popular mobile OS globally, that’s a big incentive for hackers to focus their attention on.


Application Integration

Android  Apple iOS
 Applications can talk to each other and share data.  There’s some inter process communication but it’s a bit of a fudge and for the most part applications live within a walled garden

A common question from iOS users when they first come to Android is “which apps should I install”?  “The same apps you use on iOS” is the standard sarcastic reply.

Apps aren’t the differentiation between these two operating systems.  Functionality is.  Whilst iOS has picked this up to a point, one of the really useful parts of Android is the ability to share data between applications.  Sharing links, images or other data points is significantly easier and much more widespread on Android.  And going back to your previous application without losing your place or the context you are working in is both great and easy.

This can be seen to be another example of the first principle around segregation described above.  Where Apple is trying to control what applications can do (from a security, functionality and probably battery life perspective), the barriers are much lower on Android where sub-systems and applications are much freer to  communicate and share.  For good or bad.

Core OS User experience

Android  Apple iOS
 Core applications updated incrementally.  Core applications are distributed through the Play Store and frequently updated with minor versions.  Effectively this makes operating system upgrades far less important for the user.  It also makes the user experience much more fluid and dynamic, or less politely – chaotic.  Core applications are updated with the operating system.  With it’s heritage as a company who sold boxed software, the version of mail you get with iOS 7 is the same version until the whole operating system gets an update.  Whilst this can be seen as constraining, it makes for a very consistent, controlled and polished user experience

To a point this is a direct result of the fragmentation described above wherein Google’s OS goes through a 3rd party manufacturer filter and then a mobile carrier filter before hitting the end user.  By moving previously core applications into the App Store, Google has made much of the fuss around Operating System updates obsolete.  Android users can get the same GMail experience on Jellybean, KitKat or Lollipop.

 The debate

The debate therefore is a circular and pointless one.  Depending on which of the above you consider to be more important, then either OS can be painted as the “better” option.  What is clear though is that both companies do have a clear and focussed direction and if nothing else, that’s better than a me-too product.


The Smartphone is the new computing platform

I learned this weekend that Apple thinks the desktop is it’s computing platform.   For Google the smartphone is the primary computing device.

A first world problem is giving your child a tablet or smartphone. How do they buy stuff for their device? How can you stop them running up massive in-app payments by accident.  To even create an iTunes account you need to add a credit card as proof of identity (you can delete it later but it’s a faff).

With the kids wanting to play Minecraft, the solution I came up was gift cards.  The cheapest Google play card is £10. The cheapest iTunes card is £15. Both overkill when Minecraft is only £4.99 but it gives some leeway for buying other stuff and testing the in-app payments theory without running up a massive credit card bill.






Google Play was easy. Try and buy the game, and the payment screen on the tablet has a “redeem” button. Type in your code. Job done.


iTunes was much harder.  Harder because the payment screen on the device only let’s you enter a credit card as a payment option.  An internet search implies you can top up your account online but either I was being thick or its a convoluted process that I couldn’t decipher.  Fire up iTunes on a PC and its dead easy.


So much swearing later the upshot is that I was doing it wrong. It’s 2015 and I thought we live in an smart device world and PC’s are for old people and enterprises. But it seems that Apple consider the smart phone to be an ancillary device to be managed from a computer whereas Google consider the device to be the primary computing platform.  I’d say this is probably a reflection of what the companies are; Apple is a physical products company, Google is an internet services company. But it’s an interesting reflection of the mind set and software interface design choices going on in each company


Google isn’t Apple. And why it may win

Apple is a computer company.  Google is a data and services company.  And that might mean Google win’s the long game

In q3 2014, Apple posted revenue of $37.4 billion and net quarterly profit of $7.7 billion. (source: Macrumors) What’s interesting is if you look at the breakdown of that revenue, the vast majority of that cash comes from hardware sales

And over time that percentage isn’t changing.

Take a look at a similar chart from Google (albeit from 2009) and all of the data is about their advertising.

Trying to find any kind of product breakdown on where Google’s revenue comes from is nigh on impossible.  And that’s kind of the point.  Google’s product is advertising.  So you can kind find plenty of breakdown’s on who is buying Google Ads, how the trend is moving from desktop to mobile, and how Google is trying to monetise that mobile search.  But the revenue from physical product is negligible

As shown above, Apple is a computer company.  Under Steve Job’s helm they’ve been very successful at spotting the computing trends and building products to meet that trend.  And that’s their ongiong challenge.  Apple needs to spot the next computer trend.   Admittedly they weren’t the first product to market in the mobile connected computer space (Palm and Microsoft say hi there) – but they were certainly the first to create a product that generated a mass market.  And then to spot the tablet as the next big computing platform – more product insight there.

However tablets are now in a decline.  Consumer’s are trying to get the best of worlds and increasingly moving to the phablet form factor.  Which provides apple with an interesting challenge because with their Iphone 6+ they aren’t the first to market here. Neither with their Apple Watch.  For a company so reliant on being dominant in the computing platform, not leading that market space is certainly a concern for them.

With the absence of a technology leader spotting those trends and driving best of breed products – Apple’s medium to long term prosperity will certainly be something to watch with interest

(this was supposed to be a post on why Google may win as a services company instead of a physical product company.  But it got too long winded so that post will be in a follow up – TL; DR)


Choose the Ecosystem, not the product

In 2015, it isn’t about the technology product anymore but the services provided that you’re buying into.

My current tablet of choice is an 8 inch Windows 8.1 tablet.  Windows is a much maligned operating system on a tablet.  And for the first few months I hated it. As Microsoft were late to the mobile party, they tried to mitigate their lack of apps by offering Metro plus the legacy desktop mode.  This would enable users to use their old applications on the new touch operating system.  Which has a certain logic to it but fails because when applications aren’t designed for touch, they are horrible.  Trying using the desktop version of Internet Explorer or Chrome is just a bad bad thing.  And that was my first experience with a Windows tablet.

I lived in GMail and Android and tried to bring that with me to Windows.  It failed miserably.  Google Hangouts doesn’t work.  Chrome on a touch device is rubbish.  It’s not just me though.  My Apple fanboy friend tried to change his iPhone for a Nexus.  In his Apple ecosystem he could listen to a podcast on his way home from work then pick up where he left off on his iPad or Macbook.  With the Nexus right in the middle of all the Apple gear, that workflow was broken and he quickly went back to an all Apple environment.   Other examples can be seen as the iWatch isn’t compatible with a Nexus, a Moto 360 won’t work on an iPhone, and nothing works on a Lumia ( 🙂 )

So the point is that when you’re choosing a new phone (or fancy device in general), it’s not the device you’re buying into but the overall ecosystem.  For the device to work as promised, you can’t just dip your toe in the water – you need to choose the ecosystem you want to live in.