Author name: Laura Prata

Solutions

Android Gradle Dependencies by Flavors

In a previous post about Gradle Flavors and Build Types, we mentioned that we can set different dependencies inside dependencies{} block by flavors, by build type or both combined. Below we will see an example for each situation. By flavors <flavorName>Compile apply plugin: ‘com.android.application’ android { compileSdkVersion 23 buildToolsVersion “23.0.3” defaultConfig { applicationId “com.example.diana.buildvariants” minSdkVersion 15 targetSdkVersion […]

, , , , , ,
Did You Know?

Android About ConstraintLayout

DID YOU KNOW about ConstraintLayout?   Definition ConstraintLayout is a new type of layout introduced by Android, similar to RelativeLayout but more flexible, and it is used to position UI elements relative to other UI elements by using constraints. A constraint represent the rules we have to apply in order to position our UI elements relative to

, , , , , ,
Did You Know?

Android ApplicationId vs PackageName

You might wonder what is the difference between package name we have in AndroidManifest.xml file and ApplicationId we see in build.gradle. They seem to be the same thing, but actually they are 2 different things. So if you didn’t know what is the difference between these 2 properties, you can find out now. ApplicationId represents

, , , ,
Solutions

Error:Execution failed for task ‘:Application:transformClassesWithDexFor

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 this error after updating the project to the latest Build Tools 23.0.0. After spending some hours on google to find a solution without any success, I tried to deactivate the Instant Run option from Preferences.

, ,
Tutorial

Android @IntDef Annotation Example

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 and between ({ }) paranthesis, declare your constants @IntDef({CONSTANT1, CONSTANT2, CONSTANT3}) 3. Add the @Retention

, , , , ,
Did You Know?

Did you know about Percent Support Library

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 view, using percent (%).  Usage In order to use this library you have to: 1.

, , , ,
Solutions, Tutorial

Android Set Horizontal Divider to a Vertical LinearLayout

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 not very difficult either. Before starting, you have to know the 2 major things this

, , , ,
Tutorial

Android: Add Tabs using TabLayout

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 of creating the tabs. xml in the xml file, because we use TabLayout together with

, , , , , , , , , , , , ,
Tutorial

Android Countdown ProgressBar

[vc_row parallax_image=”” boxed_columns=”” section=”” vertical_centering=”” background=”” img=”” parallax=”” video=”” bg_type=”” parallax_style=”” bg_image_new=”” layer_image=”” bg_image_repeat=”” bg_image_size=”” bg_cstm_size=”” bg_img_attach=”” parallax_sense=”” bg_image_posiiton=”” animation_direction=”” animation_repeat=”” video_url=”” video_url_2=”” u_video_url=”” video_opts=”” video_poster=”” u_start_time=”” u_stop_time=”” viewport_vdo=”” enable_controls=”” bg_override=”” disable_on_mobile_img_parallax=”” parallax_content=”” parallax_content_sense=”” fadeout_row=”” fadeout_start_effect=”” enable_overlay=”” overlay_color=”” overlay_pattern=”” overlay_pattern_opacity=”” overlay_pattern_size=”” overlay_pattern_attachment=”” multi_color_overlay=”” multi_color_overlay_opacity=”” seperator_enable=”” seperator_type=”” seperator_position=”” seperator_shape_size=”” seperator_svg_height=”” seperator_shape_background=”” seperator_shape_border=”” seperator_shape_border_color=”” seperator_shape_border_width=”” icon_type=”” icon=””

, , , ,
Tutorial

Android Floating Action Button (New Implementation)

[vc_row height=”medium” color_scheme=”” us_bg_color=”” us_text_color=”” us_bg_image=”” us_bg_video=”0″][vc_column][vc_column_text]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 gradle file and this way, you can use the

, , , , , , ,
Did You Know?

Did you know about CoordinatorLayout?

[vc_row parallax_image=”” boxed_columns=”” section=”” vertical_centering=”” background=”” img=”” parallax=”” video=”” bg_type=”” parallax_style=”” bg_image_new=”” layer_image=”” bg_image_repeat=”” bg_image_size=”” bg_cstm_size=”” bg_img_attach=”” parallax_sense=”” bg_image_posiiton=”” animation_direction=”” animation_repeat=”” video_url=”” video_url_2=”” u_video_url=”” video_opts=”” video_poster=”” u_start_time=”” u_stop_time=”” viewport_vdo=”” enable_controls=”” bg_override=”” disable_on_mobile_img_parallax=”” parallax_content=”” parallax_content_sense=”” fadeout_row=”” fadeout_start_effect=”” enable_overlay=”” overlay_color=”” overlay_pattern=”” overlay_pattern_opacity=”” overlay_pattern_size=”” overlay_pattern_attachment=”” multi_color_overlay=”” multi_color_overlay_opacity=”” seperator_enable=”” seperator_type=”” seperator_position=”” seperator_shape_size=”” seperator_svg_height=”” seperator_shape_background=”” seperator_shape_border=”” seperator_shape_border_color=”” seperator_shape_border_width=”” icon_type=”” icon=””

, , , , , ,
Tutorial

Android ExpandableList Move Item From Group to Another on Click

I needed an expandable list that would let us move item from a group to another. So I wrote this simple tutorial. It’s nothing difficult to achieve on your own, but I wanted to add this code here in case someone will need it. So, we will create an ExpandableList with items that can be moved

, , , ,
sponsored
Exit mobile version