Tag Archives: View

What is ButterKnife?

By | March 15, 2018

What is ButterKnife? Its a kind of view injection in Activities or Fragments using Annotations. Butterknife can be used to 1. Bind Views 2. Bind Clicks 3. Can be used with resources like strings, colors, Dimens, Drawables etc. Below are the annotations available AnnotationDescription @BindView Binds view object. TextView, Button, Spinner or any view object @BindView(R.id.logo) ImageView imgLogo;… Read More »

How to remove a view in your xml layout file using program?

By | September 28, 2011

Hello everyone, this is a simple example showing how to remove a view in android that is created using your xml file. This is the xml file that contains a TextView [xml] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="CoderzHeaven" android:id="@+id/tv" /> </LinearLayout> [/xml] Here is the java code for removing this view… Read More »

How to send email from and ANDROID Application programatically?

By | May 16, 2011

Hello all…….. In today’s post I will show you send mail from an android application progrmatically.. Let’s go to the code fast…… This is the code in the mail java file…. [java] package com.coderzheaven; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class sendMailDemo extends Activity { Button send;… Read More »

Customizing your button or TextView or another view in ANDROID.

By | April 30, 2011

Beautifying our applications is one of the main features of your application’s success. In ANDROID there are many possible ways to do this. For eg. We need to have different colors for our buttons, However we can give backgrounds for buttons and all. But we can do many by using our custom xml files, like changing colors on… Read More »

How to create and delete a directory in SdCard in ANDROID?

By | April 27, 2011

Hi all…… This is a simple example to create and delete a directory in ANDROID. Here the directly is created in the SDCARD. So first create an SDCARD and start the emulator with the SDCARD. Let’s look at the program. Use can use this program to create or delete a file in ANDROID also. [java] package pack.coderzheaven; import… Read More »

Android frame Animation

By | April 23, 2011

A series of frames is drawn one after the other at regular intervals. For this create a xml which contains ImageView for showing the animation [xml] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="#FFFFFF" android:gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/Image" android:layout_gravity="center_horizontal" android:layout_width="wrap_content" android:background="@drawable/d1" android:layout_height="wrap_content"/> <Button android:id="@+id/startFAButtonId" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:text="Start Animation" /> </LinearLayout> [/xml] The main java file is… Read More »

Android dialog with ListView

By | April 21, 2011

For implementing a ListView, we first create a xml which contains a ListView named list.xml [xml] <?xml version="1.0" encoding="utf-8"?> <LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"   android:layout_width="fill_parent"   android:layout_height="fill_parent">   <ListView     android:id="@+id/listview"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     /> </LinearLayout> [/xml] Next we create a Dialog Object and inflate the above xml and when the listItem is… Read More »

Expandable ListView in ANDROID using SimpleExpandableListAdapter, a simple example.

By | April 10, 2011

Hi all…… Here is a simple example of expandandable ListView in ANDROID. But I am not going to explain any code, because everything is explained inside the java file. Make sure to read it. [java] package pack.Coderzheaven; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import android.app.ExpandableListActivity; import android.os.Bundle; import android.view.View; import android.widget.ExpandableListView; import android.widget.SimpleExpandableListAdapter; public class ExpandableListDemo extends ExpandableListActivity… Read More »