android

Privacy Policy

Android Studio / IntelliJ IDEA productivity guide

Android Studio and productivity One interesting feature that Android Studio and IntelliJ IDEA have is the Productivity Guide panel. It helps you see how much of the productivity tools that are available and you are using. You can see here a quick screenshot with the one I have, on one of the computers I am […]

, ,
Tutorial

Android Simple Section RecylerView

In this tutorial I will create a simple Sectioned RecyclerView that will show 2 sections and a few items in each section and how to move an item from one section to another. Note: For RecyclerView I used AndroidX imports and not android.support.v7.widget.RecyclerView Setup We need to import the recycler view from AndroidX. The build.gradle

, , , ,
Solutions

Android Squared CardView

Recently, I had to add a perfect squared CardView and I wanted to achieve this without hardcoding its width and height. I happily discovered the power of ConstraintLayout. And so this is how I managed to create a perfect square which should work on every dimension. Heres some sample code that I used to create

, , ,
Snippets, Solutions

Android Show HTML Bulleted List from strings.xml

If you search on the internet about how to show a bulleted list from strings.xml using HTML tags, most of the answers will say that you should use a WebView, or to use the bullet symbol directly, or other alternatives. And on some posts I even read that you can’t use <li> tag from HTML

, ,
Articles

Android Activity launchMode

In Android you can specify activity launchMode. You can do this either from AndroidManifest.xml file, either using intents with flags. Some of the flags produce the same effects like those from AndroidManifest.xml, but there are some flags that can be declared only with intents and also there are flags that can be declared only inside

, , , , , , ,
Tutorial

Android ViewPager Tutorial

In Android, if you need to swipe from right to left or vice-versa in order to see different data, you can use a ViewPager. In order to use it, you have to implement a PagerAdapter which will generate the pages that the view shows. ViewPager’s adapters We can use one of the 3 adapters provided:

, , , , , , ,
Tutorial

Android ViewPager Cube Animation

After trying some libraries in order to make a cube animation for my viewPager, I realized that is pretty easy to do this. Android provides an interface called ViewPager.PageTransformer and you just have to implement its method transformPage(). Below is the code, step by step. activity_main.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”ro.helpproject.funcode.help.MainActivity”>

, , , , ,
Tutorial

Android Navigation View With Tabs

In this tutorial we will create a simple app which has a NavigationView, a Toolbar with Tabs and a simple list of items, that are displayed for each selected tab. Tools used: Android Studio 2.2 Preview 4 Android Emulator 5x API 22 Project Create a new project by choosing the empty template and then click

, , , , , , ,
Solutions

Android: CoordinatorLayout RecyclerView First Item not visible

Problem I had to implement a Toolbar with tabs, together with CoordinatorLayout, and the content of each tab had to be a list of items, for which I used RecyclerView. But when I ran the app, the first item in the list was overlapped by the tabs, so it was not fully visible. This is how my xml

, , , , ,
Tutorial

Android AdMob With Firebase

About Firebase First of all, you have to know that using AdMob with Firebase is optional, at least for now, and you can still integrate AdMob by importing compile ‘com.google.android.gms:play-services’ (like in this tutorial). But even if it is optional, it is recommended, as it brings all services like AdMob, Analytics, crash reporting and other services together in just

, , ,
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

, , , , , ,
Scroll to Top