Android, Programming, Xamarin

[SOLVED] The BindableProperty “Triggers” is readonly

TLDR: When setting the Triggers property in XAML, use the actual type of the parent tag, not a supertype.

After recently updating Xamarin Forms from 2.3.2.127 to 2.3.3.175, I started getting an InvalidOperationException: The BindableProperty "Triggers is readonly" inside InitializeComponent.

Unlike many problems, this was quite easy to track down. InitializeComponent errors are generally XAML, and in the page in question there was a single Trigger. In this case the solution was simple. The Trigger was on a custom Button type, but I was setting it specifically using Button.Triggers. Changing it to be the actual type fixed it.

So, I changed it from

<local:MyButton>
  <Button.Triggers>
    <DataTrigger ... />
  </Button.Triggers>
</local:MyButton>

to

<local:MyButton>
  <local:MyButton.Triggers>
    <DataTrigger ... />
  </local:MyButton.Triggers>
</local:MyButton>

I believe the original should be valid (and previously was) but the change is simple enough to not be a big problem.

Advertisements
Android, Android, Entertainment, Games, Programming, Technology, Unity, Video Games

Multi-platform – The real advantage of Unity

There have been quite a few mechanical additions since my last update, but the most significant thing in my latest video is it is the first on a non-Windows platform.

Unity has a large list of platforms it supports and a lot will work on all of them with no effort. For example, Gravitas currently builds and runs on Windows (Win32 and Windows 8.1 Store), Mac, Android and WebGL. With the exception of adding some settings (the Android package name for instance) I didn’t have to do anything platform specific for any of it.

Although there are very few hard limitations on what can be done on the different platforms, the wildly different performance characteristics mean you do have to think about different problems.

A more straightforward problem I recently solved (after the Day 20 – Android video was made) was to decide how to deal with different mobile device orientations.

My general philosophy is to try and support everything, so although landscape feels most natural for Gravitas, there isn’t really a reason not to support portrait. In fact, since the camera will adjust its zoom level to keep all the world on screen, it already supported portrait, albeit rather awkwardly. The dynamically generated levels are designed to have approximately a 16:9 aspect ratio. This means in portrait you get massive empty space above and below the planets, while making everything smaller than necessary. The solution? If the aspect ratio is less than 1, rotate the camera 90 degrees. This not only means portrait is supported, but in fact a far more general case of portrait-like aspect ratios is supported (and even better, has no mobile specific code at all).

Android, Programming, Xamarin

[SOLVED] Xamarin Android and “–no-version-vectors”

TLDR: An error containing “–no-version-vectors” is probably fixed by updating your Android SDK Build Tools to at least 23.

I recently upgraded a project to the latest version of Xamarin Forms and got the following error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 2. Output: ERROR: Unknown option '--no-version-vectors'

A quick $ grep -ri "no-version" . on the project revealed it was being used in a dependency brought in by the Forms update:

./packages/Xamarin.Android.Support.Vector.Drawable.23.3.0/build/Xamarin.Android.Support.Vector.Drawable.targets: $(AndroidResgenExtraArgs)--no-version-vectors

Long story short, this parameter is for the aapt tool in the Android SDK Build Tools from at least version 23. Updating through the Android SDK manager fixed it.

Android, Entertainment, Games

Betrayal at House on the Hill – Betrayal Character Cards for Android

Betrayal at House on the Hill is a board game published by Avalon Hill and designed by Bruce Glassco. The game is split into two parts. In the first, the players become trapped in a haunted house which they must explore, revealing rooms as they do. At some point the second part, the “haunt”, begins in which one player (generally) becomes a traitor and everyone plays out one of 50 scenarios pitting the traitor against the others.

An important part of the game involves tracking each of the player’s attributes (each character has a different range of possible values for each attribute). Since the included cardboard trackers can be loose and tend to slip out of place, a few different smartphone apps have appeared to help the situation.

The earliest Android version is Betrayal Character Cards. This app does the bare minimum needed. You can see a list of characters, see their attribute ranges and select the current value for each. As a small extra it also includes the birthday and hobbies of each character (which has a minor gameplay purpose).

Out of the apps available this is the simplest and has the least features. On the other hand this should run on the widest range of devices.

Android, Books, Entertainment, Reviews

Department of Temporal Investigations: Watching the Clock

This was originally posted on 2011-05-20 at 10:22, but has been reposted because of cool layout updates. Also, as part of my plan to post more reviews of Star Trek novels.

I recently started buying and reading a lot of Kindle Star Trek novels (on my Nexus One Nexus 4 incidentally – I don’t have a Kindle). Although a part of me is mildly worried and annoyed at the closed DRM’d nature of Kindle eBooks (and often the price) the ease and convenience has won out.

Star Trek novels have a improved a lot since I read them previously many years ago. Not necessarily the stories themselves but that there seems to a serious concerted effort to maintain continuity between, but without requiring too much knowledge of other books to read any given book (although there are more series now which obviously do require you to read them all for it to make sense).

With that in mind, before reading DTI: Watching the Clock you should definitely read the Destiny series and possibly the Typhon Pact series and the Titan series. Everything you need to know about them is explained in the book but it does spoil them a little if you do intend to read them at some point.

Department of Temporal Investigations: Watching the Clock

★★★★★

Oliver Brown

2011-05-20

product

If you ever thought time travel in Star Trek didn’t make sense (and would like it to) then this book is for you. Truly awesome.

Time travel in Star Trek has always been a slightly problematic topic. Featured as the primary plot device in many episodes (and several movies), it was always handled differently and never followed any discernible rules. This book tries to straighten this all out (or as Douglas Adams once said make it, at least, firmly crooked) and on the whole, succeeds.

The book feels like a collection of short stories about time travel, tied together with an over-reaching story arc (complete with seemingly insignificant events in one “story” that become important later). Many of them are about how the DTI dealt with the aftermath of different time travel events in the show. In fact practically every Star Trek episode that dealt with time travel is mentioned (except for new Star Trek movie) and explained to some extent. A couple of the big ones (specifically Star Trek: First Contact, the Temporal Cold War and the whole of Voyager) are more central to the story.

Aside from the technical aspects of time travel, the book also devotes time to expanding the main characters, Dulmur* and Lucsly, who were introduced to us in the Deep Space 9 episode, “Trials and Tribulations”. As the blurb says: “There’s likely no more of a thankless job in the Federation than temporal investigation”. Considering how interesting the time travel elements are, I expected to find these parts more boring than I did. In fact after seeing how they deal with some of the Starfleet officers (and more specifically how the Starfleet officers deal with them) I thought about Sisko’s reaction to them and found him downright annoying.

So the bottom line is, the only reason I can think for a Star Trek fan not to read this would be that you want to read some of prerequisite books first (Destiny, Typhon Pact, Titan).

*Dulmur or Dulmer? I always thought Dulmer since their names were supposed to be anagrams of Mulder and Scully. The author however uses Dulmur consistently and there is a point in the story where the spelling confusion is referenced explicitly.

Amazon UK Amazon US
DTI: Watching the Clock DTI: Watching the Clock
Destiny #1: Gods of Night Destiny #1: Gods of Night
Typhon Pact #1: Zero Sum Game Typhon Pact #1: Zero Sum Game
Android, Technology

Swype is amazing!

One of the things that worried me about touchscreen phones (before I got one) was typing with an onscreen keyboard. Therefore, the first touchscreen phone I got was the T-mobile G1, a phone with a hardware keyboard.

Since then I had an opportunity to get a Nexus One which I couldn’t ignore. And I generally dislike the onscreen keyboard as much as I expected.

That has just changed however.

I just downloaded the beta of Swype for my Nexus One and the improvement is tremendous. Instead of tapping letters, you press and hold the first letter and then drag over the other letters. With a combination of seeing when you pause and a dictionary lookup, it picks up the word you wanted to type (it works a lot better than you’d expect). There are a few issues, specifically it has difficulty with very short words (mainly because there are generally more possibilities) and there is the pathological case of pit/pot/put being difficult to differentiate. But on the whole, it’s definitely an improvement.

By the way, I typed most of this on my Nexus One (using the official WordPress App). I added the links afterwards.

Here are some videos.