Tag Archives: Res

How to build a custom progressBar in android- Part 2?

By | May 12, 2012

Hello all……. Today I am going to show you how to create a custom progressbar in android. Previously in another posts I have already shown how to build a custom indeterminate progressbar in android. And in this post I will show you how to customize the horizontal progressbar. OK Now we will start. First create… Read More »

How to download a file from a remote site in android? – Another simple example – Method -3

By | May 7, 2012

Hello all ……. I have shown many examples on how to download and upload files in android through this site. These are other methods for downloadign a file in android. 1. How to Download an image in ANDROID programatically? 2. How to download a file to your android device from a remote server with a… Read More »

How to download a file to your android device from a remote server with a custom progressbar showing progress?

By | April 29, 2012

Actually this is really simple. I have already posted an example for how to download a file in this post. How to Download an image in ANDROID programatically? This is another one little different with a progressbar included. Previously I have shown three other methods to upload files to a server. Check these posts to… Read More »

Zoom In animation between Two Activities.

By | April 28, 2012

Hello everyone… I have already shown you how to override default animation between activities. Today I will show a zoom in and out animation between activities. Take a look at this post for another animation between activities. Create files named zoom_enter.xml and zoom_exit.xml in the res/anim folder. zoom_enter.xml file contents. zoom_exit.xml file contents. Now replace… Read More »

How to upload an image from Android device to server? – Method 4

By | April 26, 2012

Hello all…. This post is also about uploading an image to server from your android device. Previously I have shown three other methods to upload an image to a server. Check these posts to refer this. 1. Uploading audio, video or image files from Android to server 2. How to Upload Multiple files in one… Read More »

How to inherit from other styles or how to extend your own styles in android?

By | April 17, 2012

Hello all…. I have covered many tutorials on styles on how to implement and use them. Today I will show you how to inherit from other styles or how to extend a style already created by you and use it for applying to other views. Here is one of my previous posts. http://www.coderzheaven.com/2012/02/03/changing-the-style-or-theme-of-default-alertdialog-in-android/ Another one… Read More »

How to create shortcut for your application in the Desktop in Android?

By | April 7, 2012

Shortcuts are really useful feature in android. This example also explains how to create shortcut for your app in the desktop of your android phone. This is the complete code of an application which creates a shortcut of this app in the homescreen. Note : You need to add permission for this to work. Now… Read More »

Passing data between Intents or classes in ANDROID?

By | March 29, 2012

Many of our application reqiures sending data from one intent to another. This is done by putting data into one intent using putExtras() and getting it in the other intent using the getExtras() which matches the string value. However you can pass string, boolean, integer etc between intents. For passing data between intents you need… Read More »

Custom Indeterminate progressBar for android?

By | March 29, 2012

Hello everyone… Today we will see how to customize an indeterminate progressBar in android. For that we have to create an xml with a progress animation.For this I used these three images Inside the folder res/drawable create an xml named “progress_indeterminate_horizontal.xml” and copy this code into it Now the layout file containing the progressBar.I named… Read More »

Custom GridView in android. A simple example.

By | February 29, 2012

Hello all……….. Android has been absoultely wonderful for customizing widgets. I have shown a lot of example to customize ListViews, spinners etc. Today I will show you how to customize gridviews. Using this method you can actually place anything inside a gridview even a webview also. So here we start. We customize a gridview by… Read More »

ListView with Sections in android.

By | February 24, 2012

Hello all………. We have seen many posts about ListViews like creating a listview, adding data to it, customizing a listview etc. Take a look at some of these examples 1. Single Selection ListView in android 2. Flitering a ListView using an input from an EditText in Android. 3. How to create a custom ListView in… Read More »

Changing the style or theme of default alertDialog in Android.

By | February 3, 2012

Hello everyone, Here is a simple example showing how to change the theme of default AlertDialog in android. Check this post before for understanding how to use styles. http://www.coderzheaven.com/2012/04/17/inherit-styles-extend-styles-android/ To start first create a fresh project named AlertTest. In the AlertTestDemo.java file copy this code Now create a file named “styles.xml” inside the res/values folder… Read More »

Saving TextFile to SDCARD in android?

By | January 29, 2012

Hello android lovers, In today’s tutorial I will show you how to 1. Create a text file and save a textfile in your SDCARD in your preferred path. 2. Read the contents from the same file and show it in a TextView. For writing a file we use the FileWriter class and for reading the… Read More »

Single Selection ListView in android

By | January 8, 2012

Hello all….. In today’s post I will show you how to create a single selection list in android. Here is the main.xml Now this line in the java file creates the single choice. setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_single_choice, android.R.id.text1, names)); Now this is the full java code

Image transition animation in Android

By | December 29, 2011

Hello all… I have shown a lot of examples of animations in android. Today I will show you how to show an image transition animation between two images. For that you have to create an xml named “expand_collapse.xml” inside the res/drawable folder. The contents of “expand_collapse.xml” are Now in the main.xml place an imageView to… 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 change the default transition between activities?

By | October 26, 2011

In android the default transition between activities is to slide from left to right. But with custom animations we can change that. First create a folder inside the res/drawable folder called “anim”. Then create a file named “fade.xml” and copy this code into it. create another file named “hold.xml” in the same place hold.xml. activity_animation.xml… Read More »

How to use shapes in android? A simple example.

By | October 23, 2011

In android with shapes we can create beautiful layouts. Lets look at an example. Create an xml named “gradient.xml” in your drawable folder and copy this code into it. Now the main layout file main.xml The main java file. Done. You can now run the application.

How to create a splash screen in android?

By | September 10, 2011

Hello everyone today i will show you how to create a splash screen in android. This is one of the simplest ways to create a splash screen however there are another ways to create the splash screen. Lets look at the code. We need two layouts one for the splash screen and another for the… Read More »

How to close All activities in your View Stack in android in one click?

By | August 27, 2011

Hello everyone… Today I will show you how to close all views in android in a single click of a button. Basically if you open a number of activities, each activity is stacked one above the other like a stack if you are not calling finish() on each activity. But there is a way to… Read More »

How to use RadioButtonGroup in Android?

By | August 20, 2011

Hello everyone , In today’s tutorial I will show you how to how to use RadioButton group in Android. Lets go directly to the code. Let’s see the layout for the RadioGroup first. The file is named main.xml This will create a layout file with a radioGroup with 5 radioButtons and a button to clear… Read More »