Get screen size

Catalin Prata
So if you ever need the screen width and height on Android, you can use the following snippet: Get screen size on Android Java /** * Returns the size of the screen in pixels (width and height) * * @return...
Read More

Error:Execution failed for task ‘:Application:transformClassesWithDexFor

Laura Suciu
Error:Execution failed for task ‘:Application:transformClassesWithDexForMyFlavorName’. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java” finished with non-zero exit value 2 1 2 Error:Execution failed for task ‘:Application:transformClassesWithDexForMyFlavorName’. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java” finished with non–zero exit value 2 I had...
Read More

IntelliJ IDEA / Android Studio key shortcuts

Catalin Prata
This is just a small productivity A4 poster with MacOS IntelliJ IDEA and Android Studio key mapping that can be placed on your wall :). MacOS IntelliJ IDEA/AndroidStudio keyboard shortcuts  
Read More

Android @IntDef Annotation Example

Laura Suciu
Android has some helpful annotations in the support library so, in this post, I will show you an example of how to use @IntDef annotation. You can use this annotation (or @StringDef annotation) instead of Enum. Steps 1. Add your constants 2. Add the @IntDef annotation...
Read More

Did you know about Percent Support Library

Laura Suciu
Yes, we can finally get rid of hardcoded values or nested layouts used in order to take advantage of layout_weight.  Definition Percent Support Library is a new library introduced by Google, used to set the width, height and margins for a...
Read More

Android Set Horizontal Divider to a Vertical LinearLayout

Laura Suciu
If you need to use a “list” divider, but you need it on a vertical LinearLayout instead of a List you can do this by using some attributes on the LinearLayout. It’s not very straightforward as you maybe expected, but it’s...
Read More

Android: Add Tabs using TabLayout

Laura Suciu
In this tutorial we will see how to add tabs to a project by using TabLayout together with ViewPager, and some other new views from the design library 🙂 Before starting I will make summary to present the main idea...
Read More

Android Countdown ProgressBar

Laura Suciu
Recently I needed to make a progressBar to update its progress smoothly for a given period of time (I needed a countdown). So after some research on Google, I ended up using an ObjectAnimator in order to achieve this. For...
Read More

Android Floating Action Button (New Implementation)

Laura Suciu
The previous tutorial about Floating Action Button implementation is now deprecated regarding that now, there is a support library from Android which makes the implementation of FAB more easier. You just have to add to dependencies the Design Library in your...
Read More