ing. Andrea Maglie

Don't waste your time coding - part 1

Life is too short: please, don’t waste your time writing code! I’m not saying that you don’t have to code, but many people tend to waste too much time typing on the keyboard instead of producing code. Mee too. Following examples relate to Android’s world, but that can be easily adapted to other languages and programming tasks. Aliases Android... Read more

Auto-increment versionCode in build.gradle file

Starting from this blog post by Bryan Rosenbaum, here is a gradle task to auto increment versionCode inside your build.gradle file. import java.util.regex.Pattern ... task incrementVersionCode << { println(":incrementVersionCode - Incrementing Version Code...") def buildGradleFile = file("build.gradle") def patternVersionCod... Read more

Android Fragment Code Generator

There are many ways to create a fragment in Android, but to create a fragment properly you need to follow specific guidelines. For example, it’s required that the class has a public zero-parameters constructor. If we need to pass parameters to the fragment, we need to use the method setArguments(). Try to pass some parameters to the constructo... Read more

Working with boolean and Parcelables

Here are two simple methods to write a boolean value into a Parcelable object and read a boolean from a Parcelabe. Read more