Playing around with Kotlin and Anko

 

Kotlin Language has been around for a while and recently matured to 1.0! There’s a lot of information out there explaining what modern language features Kotlin offers and what the benefits compared to good old verbose Java are, so I’m not going to cover those here. Instead I’ll be describing how to setup a Android project with Kotlin and Anko to see how a sample Kotlin Android app would look like, if it’s more readable and how much less boilerplate we have to write, since I was curious myself and just did. Let’s have a look, shall we?

Read more

Unit testing your Android Application using Groovy and Spock Framework

 

Unit Testing is a controversial topic. Everybody agrees it is a good thing and everybody should do it, but most projects I’ve seen do not, or not anymore. Which is a pity, since it can be – from a development standpoint – quite fun to write. I recently ran into the Spock framework, which lets you write unit tests using Groovy, and had to give it a try. Here’s a brief introduction.

Read more

Quick look on the CoordinatorLayout

 

As you might have noticed, Google recently released the Android Design Support Library, which allows you to bring Material Design Patterns to previous Android versions – back to Eclair – with relatively low effort. The design support library library ships with a number of handy components, all of which introduced in the original announcement by Ian Lake.

This blog post will briefly demonstrate the usage of the CoordinatorLayout to achieve a parallax header image effect and a floating action button which is aware of a snackbar being displayed and automatically animating itself out of the way. And that with pretty minimal effort – meaning that there’s no manual position calculation and animations required. This works right out of the box.

 

Read more

Having a look at Androids VectorDrawable

 

With Android Lollipop some nifty features were added. Among those VectorDrawable‘s and AnimatedVectorDrawable‘s. Let’s have a look at them.

VectorDrawables lets you declare and use vector images on Android and even run nice animations on them. As usual you would declare vector resources in XML. The notation is the same as for Scalable Vector Graphics (SVG). Although as of now, only a subset of SVG is supported.

For demonstration purposes we’ll declare a star shaped vector image, add some rotation, scaling and path morphing animations. We’ll be morphing into a pentagon shape. The shapes are not that hard to construct. You might just need a vector graphics tool that is able to export to SVG. If the shapes are not too complex that is, since not all of SVGs features are supported. I created the star and the pentagon using Inkscape with some manual tweaking. If you are creating by hand using RaphaelJS on jsfiddle is pretty convenient. The shapes I created look like this:

Read more

Nvidia display driver issues on Ubuntu

 

I’ve been having trouble with the Nvidia drivers for quite some time now – a year at least. Every now and then after updating packages via the¬†Software Updater (I haven’t kept track of which packages exactly caused problems) the system would keep working until the next reboot and then things would get ugly. The login manager appears in very low screen resolution, things are pixelated and when I try to log in, everything freezes. This happened on 12.04 – which I ran quite a while before upgrading to 14.10 – and guess what? Same problems on 14.10 as well.

There are a lot of people having these or similar issues and there are a lot of confirmed bug reports on this. For instance this on launchpad. Fixing these issues seem not to be trivial, I believe the drivers being proprietary does not help. Anyway, time for me say to goodbye to Nvidia drivers. After many not-so-well-spent hours of repeatedly getting my computer back to run, this is it.

Read more

Fremdwort des Tages Update 1.1.1

A new update to the Fremdwort des Tages Android App is out. The updated versions include:

version 1.1.1 (2015-03-27)

– Bugfix release

 

version 1.1.0 (2015-03-26)

– pagination on loanword detail page
– load-more functionality when reaching the on the of loanword pager
– expanded touch areas
– updated looks
– technical refinements
– fix on possible NPE

Find the Fremdwort des Tages App in the Play Store.

 

Automated Builds for your projects on Github

 

If you are looking for an easy way to apply continuous integration to your projects on Github, Travis CI might be for you. Travis is a service offering continuous integration to your repositories on Github. If you are in the area of software development professionally, I am sure you are doing CI of some flavor: Jenkins, Bamboo, TeamCity, or any other CI tool that fits your needs. And if by any chance you are not (and you probably should!) Travis might be worth having a look at. Or if you are looking for an alternative, some way to reduce load on your existing server infrastructure, something for the projects you are working on in your free time or just out of curiosity. Here is a quick look on Travis.

 

In this post we will be setting up automated builds for a Github project. Every time commits get pushed onto the repository, we want Travis to automatically trigger an automated build for us so that we know the code still compiles in an environment other than the machine the code were developed on. For this I will again take one of my Android projects as an example.

Read more

Persistence on Android using ORMlite

 

Everyone knows the hassle of persisting objects to relational databases. Who hasn’t spent hours, days and (let’s be honest) weeks fighting object-relational mappers? It apparently is a hard and time consuming task, often times a real pain in the a** and subject to critic and hate. There are plenty good ORM mapping tools out there. JPA, Hibernate, you name it.

 

In this post I will present you a simple lightweight one to use with your Android projects: ORMlite for Android. I recently used it in one of my open source Android projects and it’s quite simple to use. I will use that project as an example and give you a step-by-step introduction on how to use ORMlite to easily store your data in a SQLite database on Android.

Read more