Keep your Intents in your Activity

There is this pattern commonly used with Fragments which is having a public static Fragment newInstance() method to instantiate them. The reason behind this is, since Fragments must (or at least are recommended to) have an empty constructor, to pass your arguments through this method via a Bundle to the…

Generate Android Log Tag in Studio/Intellij

Everything I do more than once I try to automate. For example creating a static variable TAG in a class for logging. In Android Studio/Intellij you can create a live template to make this quicker. Go to Settings > Live templates > Add, enter tag in the abbreviation, a…

Inject dynamic host IP address with Gradle

If you're developing an Android app which requires any kind of server you probably have to update the IP address of your local testing server every time you start developing. Since as developers we don't want to do things more than once, we need to automate that. Luckily with the…

Organization tips for Android projects

If you develop apps for Android you may have noticed, that you quickly lose the overview of your layouts, ids, drawables, packages, etc. I want to share my experience with you and suggest a few tips, how to organize your projects. I consider myself to these rules, because they help…

ListView with Sections/Separators

If you've ever used ListView, and i bet you had, then you will have noticed that it is not very handy if you want to display a huge amount of data. I found a few solutions, how to categorize list items like in your phones preferences. This post won't be…