Tag Archives: Implements

How to write interfaces in java or Android?

By | February 7, 2013

This tutorial is about how to use interfaces in java or Android. What is an Interface? An interface is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface. An interface is not a class. Writing an interface is similar to writing a class, but they are… Read More »

How to pass an Object from One Activity to another in Android.

By | November 5, 2012

Hello all This is a simple post that shows How to pass an Object from One Activity to another in Android. I am going to pass the following object from One Activity to another. MyObject{ String name; String website; } This is the class that defines the Object. This is the first activity that sends… Read More »

Dynamically Adding, Removing, Toggling and Removing all ActionBar Tabs in Android – Part 2?

By | October 8, 2012

Hi all.. In today’s post I will show you how to add actionbar tabs dynamically, remove one by one , hide and unhide them, removing all tabs at once etc. This simple java code does that. First create a project and in the MainActivity, paste this. You may be getting many errors, we will be… Read More »

How to read and write files to SDCARD and application SandBox in Android – A complete example?

By | September 6, 2012

Here is a complete example of How to read and write files to SDCARD and application SandBox in Android. First create a new project and inside the mainActivity paste this code. Now create another class named MyFile.java and copy this code into it. Now the layout for the xml file. Note you should give this… Read More »

How to stream an audio in Android?

By | August 14, 2012

This is a simple example to how to stream an audio in android. Here is the java code for that. This is the xml that contains the button. When you run this program you will see a button and on clicking on that button you will see a dialog with message “Buffering…..”. Once the buffering… Read More »

Serialization in Android – A Simple example.

By | July 25, 2012

Serializing a class file provides a fast and efficeint way to store information produced by your application! What is serialization? Serialization is essentually taking a screenshot of a class file and its contents. For example, lets say you have the following class: Now we will save this data to a file in the SDCARD. Make… Read More »

How to use Accelerometer in Android?

By | May 30, 2012

This is a simple post showing how to use accelerometer in android. This java code prints the values of x,y and z axis in the console. Leave your comments on this post. Find Coderzheaven on facebook, twitter , google Plus and MySpace for more updates.

How to Sort a String array in Android.

By | February 25, 2012

Hello all…. This is a simple example showing how to sort a string array which is a arraylist in android. we sort the array using the “Collections” class in android. Here is a simple example Take a look at the LogCat for the output.

How to create a custom layout for your camera in Android?

By | December 28, 2011

Hello everyone, Today’s example shows how to create a custom layout for your camera preview, that is if you want a custom layout while your camera is opening. This example helps you to achieve this. First create a fresh project and name it CameraCustomLayout and copy this code to CameraCustomLayout.java file. After that create an… Read More »

How to show a sliding window from below in Android?

By | December 22, 2011

Hello everyone, I have already showed you how to use a SlidingViewer to create a slidingWindow. Today I will show another way to create such a window with the help of animation. Please check one of my previous posts to do this in another way. How to show a sliding window from below in Android?… Read More »

SlidingDrawer in Android, A simple example.

By | December 1, 2011

Sliding-Drawer in a nice and useful widget in android. Please check one of my previous posts to do this in another way. How to show a sliding window from below in Android? Check this new One using Navigation Drawer About Sliding drawer SlidingDrawer hides content out of the screen and allows the user to drag… Read More »

How to get the current progress on your SeekBar in android?

By | August 11, 2011

I have already shown how to use seekBar in android. This simple snippet helps you to get the current progress in the seekbar. It’s same code from this post, only thing is I added the getProgress method. Check the Logcat for the current progress or the TextView in which I am showing. Take the xml… Read More »

How to use SeekBar in ANDROID?

By | June 21, 2011

Here is a simple example to show how to use seek Bar in android. Create a new project and place this code in it. The main.xml file The strings.xml file. Here is another example to show How to get the current progress on your SeekBar in android? Please leave your valuable cmments

Simple View Animation in ANDROID?

By | June 11, 2011

Hi all….. In this post I will show you a simple animation using a textView. It’s really simple. Steps. 1. Create a fresh project and copy this java code into it. 2. Create a folder named “anim” inside the res folder and create a file named “animation.xml” and copy this code into it. 3. copy… 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 Next we create a Dialog Object and inflate the above xml and when the listItem is clicked then a Alert Dialog windows comes The java file is listed below The alert window look like this When the Item is selected… Read More »

How to use progress bar dialogs and custom Dialogs in ANDROID?

By | April 15, 2011

Hi, In most situations we have to use progress bar dialogs, Alert View Dialogs and Our own custom Dialogues in our applications. In most situations the built in dialogs may be enough but in certain other situations we have to build our own dialogs for better user experience. But still there is problem people don’t… Read More »

Text to speech in ANDROID, A Simple Example.

By | April 9, 2011

Hello everyone…….. In this simple example I will show you how to use Text To Speech in ANDROID. This is one of the unique features in ANDROID. Unlike iPhone , ANDROID has a built in TTS Library which supports many languages. But iPhone doesn’t have this feature. They have to depend on third-party software for… Read More »

Using Gestures in ANDROID,A Simple example.

By | March 29, 2011

This is a really simple example illustrating gestures in ANDROID. You Know that everything you do with your hand inside the phone is a gesture like SingleTap, doubleTap etc. Here is a quick illustration of this. For this the activity must implement OnGestureListener. The GestureDetector detects the gestures. Let’s look at the example. The layout… Read More »