All posts tagged “quickies”

libgdx and Vector2 mutability

Here’s a quick post to rant about something that’s been affecting me for the last couple of days.

Recently I find myself toying around with libgdx to work on a game that I’ve been meaning to develop for a while. The problem with this library is that apparently, all Vector2 functions affect the actual vector on which they are invoked. This goes against the Java standard of immutability for non-primitive types and is incredibly annoying, especially because these functions will also return the vector for chaining.

Why is this annoying? Well, when you’re used to the Java standard, you don’t expect any functions to affect the actual object. Think for example about Java’s String.split. This will never affect the String itself, especially because the String is immutable. Affecting the String would mean creating a new instance of that string with the change applied to it.

Frankly, I’m not sure what happens in the backstage but this stinks.

[Quickies] Why can’t I move (certain) applications to the SD card?

Following up on the previous “quickies” format, I decided to answer a question that goes unanswered through a quick Google search. This quickie has to do with the Android OS platform.

Question: Why can’t I move certain applications to the SD card?

Answer: The “move to SD card” feature of Android MUST be explicitly enabled by the developers of each application. This is the reason why for some apps, the “move to SD card” button is greyed out.

Hope that helps anyone who’s ever asked Google this question!