Posted by & filed under Play Framework, Scala.

When you’re trying to update your Play! Framework Project from version 2.0.x to 2.1 then follow these easy steps.

Install Play! 2.1

First follow the official guide to download and install the new version of Play!

Update your project

Secondly follow the first two chapters of this official guide

Your update should be ready. I ran into the following error after the update:

To solve this error open \framework\build.bat and change


Update the IntelliJ Idea files

At last remove the .idea, .idea_modules and target folders in your project folder and fire up the play console for your project and run the command “idea” to update IntelliJ Idea files!

Posted by & filed under Android, Java.


I sadly do not have time to maintain the code. Additionally I haven’t worked with Android code for quite some time now. Please check out this awesome project if you want to have the switch and many other cool features.


A little time ago I started working on my own Switch button for use in Gingerbread & co. My own version was a little different, because it displayed both sides of the switch instead of only displaying the selected side. I got a lot of feedback for this implementation and some feature requests like disabling the button. So I now completely backported the original Switch for API level 8+, including Froyo and Gingerbread. I also switched to github for this project.

You can either visit the project on GitHub, or download the project here. For documentation and a tutorial on how to use the switch and even in combination with ActionBarSherlock continue reading after the break.

Read more »

Posted by & filed under Android, Java, Tipps & Tricks.

Ever wanted to use a StackView and have a X out of Y counter to show the number of the currently selected View. Nope. Not possible. I don’t know what the folks at google thought but neither the StackView, nor the AdapterViewAnimator call the OnItemSelectedListener as soon as the user selects another View from the StackView.

Fortunately I found an easy to use solution. View the code after the break!

Read more »

Posted by & filed under Android, Java, Tipps & Tricks.

Important notice: I have a newer version available right here

I was coding for my new app and wanted it to be available for a large user base, so Android API Level 10 (Gingerbread) had to be the minimum SDK version. I also wanted to have a Switch button introduced in API Level 14 with Ice Cream Sandwich.

An image of switches introduced in Ice Cream Sandwich. This image is from Jelly Bean. An image of switches from Jelly Bean.

I really like the design of the ICS-Switch-button, but it bothers me, that you do not see the other, currently not selected, text. In my head you would always see both texts and the blue rectangle would highlight the text that is currently selected.

So I took the images and the code of the ICS-Switch button and began coding my own version. Here is the result:

Switch Button Demo

Screenshot of the new Switch Button

Find the code and some explanations after the break:

Read more »

Posted by & filed under Android, Java, Tipps & Tricks.

I was in need of a TextView that has a fixed with but dynamic content, so I needed the content to automatically scale.

The AutoScaleTextView takes the android:textSize value and uses it as the preferred text size. You can also set the minimum text size. The default for the minimum text size is 10dp. The AutoScaleTextView now tries to take the maximum value between the preferred and minimum size that fits into the Views width (with regarding the padding).

Here is the result:

The AutoScale TextView in action displaying the android version names

You can see that the AutoScaleTextView automatically scales the text to fit in the Views width. For the different views I used layout_width: 130dp and layout_height=30dp, textSize: 16dp and 10dp for the minTextSize. On the second Ice Cream Sandwich TextView I used 13dp for the minTextSize and layout_height: wrap_content.

Get the source and explanation after the break.

Read more »