Iced Tea Labs Share to be shared

Tab Layout

A - Introduction about Tab Layout To implement the content of a tab, we have 2 ways: Using tab to navigate among views in a same activity Using tab to navigate among activities In this post, I’ll show you the second way. B - Step by step demo Firstly, create a new project named TabLayout Next, create 3 different activities: ArtistActivity... Read more

2D Graphic in Android

I - Introduction 2D Graphic in Android In Android, to draw anything you always need 4 basic components: An object type Bitmap to hold all the pixels you need to draw An object hold all the drawing stroke (Rect, Path, Bitmap,...) An object type Paint to define the color, style for your result An object type Canvas to operate drawing command ... Read more

Custom Button

Sometime, you don’t want to use provided buttons style of Android like this: You want something’s special, an GUI in your own and unique style. In this post, we will create a custom button using basic Button control and XML file that defines 3 different states of the button: normal, focused and pressed. First, copy 3 images below into res/d... Read more

Custom Radio Button & Custom Checkbox

In previous post “Custom Button” we know how to customize a default Button of Android. Similarly, in this post, I will show you the way to customize default Radio Button and Checkbox using XML file and desired images. Copy these images to res/drawable folder: Define an XML file to specify desired appearance for each state of Radio Button: ... Read more

Use Existing SQLite Database in Android App

In my previous post about SQLite , I only post the way to create database when application started. In reality, we do not only need a database to store data but also need one to read information from. So, in this post, I will show you how to use existing SQLite database in Android app. The basic idea for this case is instead of creating a new... Read more

Fragment

A - Introduction Fragment is some kind of “small Activity”. It can be embed into an Activity and reused in others. With Fragment, It’s easier for you to design multi-GUI for handset, tablet… Fragment has its own sets of views, life cycle and can interact with the parent Activity. B - Fragment life cycle Fragment life cycle is affected dire... Read more

Custom Toast

A toast is a view containing a quick little message for the user. It will never receive focus and will be dismiss after a specific time. By default, if you want to call a simple Toast, all you need is just one line of code: Toast.makeText(context, text, duration).show(); And you will get the result like this: More than that, this entry will ... Read more

Custom Dialog

You are developing an Android app and you don’t want to use the default dialog like this: You want something is unique and customizable like this: This post will guide you how to create a custom dialog in Android! Firstly, create an XML layout for your custom dialog: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/a... Read more