Tag Archives: Xmlns

Creating a Clock Widget in Android with Custom Font.

By | September 10, 2013

Hi all if you have been a regular visitor of this website you have seen that I have shown you how to create a simple widget, adding controls to it, adding event handlers in the views etc… Do check this website for more tutorials on widgets. You can find other tutorials by following this LINK.… Read More »

FlipCard animation using Fragments in Android.

By | August 17, 2013

Hello all I am back with fragments again. I know you have seen a lot of posts on fragments and fragment animation. This one will be another useful post for you. This post helps you to show a FlipCard animation using Fragments. Let us see how can we do this. At first I will show… Read More »

How to get a return value from a DialogFragment? or Using DialogFragments in android.

By | July 1, 2013

Hello all…… This post examples how to get an edittext value from a dialog fragment. You can use the same method to get a button click from a dialog or events like that. You can click on the download link to get the source code. At first we will create a layout for the Dialog… Read More »

How to display a context menu from a fragment?

By | June 9, 2013

Hello all I think you all know about the context menu in android. It appears as a popup when you long press something. Fragment also provides some methods for registering with the contextmenu and showing it. Let’s see how we can do it. You can click on the download links to download the source code.… Read More »

Custom Spinner in Android Redone using BaseAdapter..

By | January 10, 2013

I have already shown another example of creating custom spinner in android in this post. That was by extending the ArrayAdapter class, Now it’s using the baseAdapter class. You all knew that a spinner or combobox is an inbuilt widget in android. And Like any other widgets spinners are also customizable. Here is a simple… Read More »

How to copy a file to another saved in SDCARD in Android?

By | December 30, 2012

Hello all… This tutorial explains how to copy a file contents to another in Android. The file to copy is saved in SDCARD, however you can change the path to save it in your application sandbox. if you want to save it in your sandbox, change the path to /data/data/your_packagename/your_file.extension Now we will see the… Read More »

How to store an Image from Android to a SQlite and retrieve it?

By | December 23, 2012

Hello all… In today’s post I will show you how to store an image in an SQLite database and retrieve it. First I will just create a Database Helper Class for adding and reading from the Database. Our Database contains only one table “Images” with two columns “id” and “image”. Note : If you want… Read More »

How to crop an Image in Android?

By | December 15, 2012

This is a sample program that launches the camera and crop the captured image. Check this link to another crop image example. http://www.coderzheaven.com/2011/03/15/crop-an-image-in-android/ This is the layout xml. activity_main.xml Now this is the Main Java File that implements the crop functionality. Here we are using the “com.android.camera.action.CROP” Intent to crop the Image passing the captured… Read More »

How to create Swiping Windows in Android from Android 2.1 onwards?

By | November 28, 2012

Have you seen the Google Play application in your Android phone. Wondered about how they implemented swiping windows in it. Don’t Worry, Here is an example which implements it. Here we will create three pages which can be swiped to access it. These are the three layouts for the three sections. section1.xml section2.xml section3.xml Now… Read More »

How to load a spinner with values from SQlite Database in android?

By | November 18, 2012

Here is a simple example showing how to load a database values in a spinner in android. OK we will start. This is the layout for the spinner row. spinner_row.xml This is the layout for the interface. activity_main.xml Now this is the MainActivity.java file that uses the spinner and the database. Join the Forum discussion… 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 »

How to pass an arraylist value from one activity to another in android?

By | October 28, 2012

This simple example shows how to pass an ArrayList from one activity to another in Android. This is the first activity on which we are sending the arrayList. MainActivity Now this is the Second activity in which we are receiving the passed arrayList. SecondActivity Please check the Logcat for the Output. Source code You can… Read More »

How will you create a custom Notification in Android with a custom Layout?

By | September 15, 2012

This sample application does that. First create an xml for your notification. custom_notification.xml Now the java code.

How to create a Scrolling Text (marquee) in android using TextView?

By | September 15, 2012

OK At first we will create the XML that contains a TextView. marqueetext.xml Now the java code Note : The XMl alone will not create the marquee. For that the most important thing is to do this in java code. Now run the project and see the result.

How to create a Slide from Left animation while deleting a row from a ListView in Android?

By | September 12, 2012

Hello all…… I have written a lost of posts on Listviews. You can see that by just searching Listviews in my site. Today I will show you how to create a slide out animation while we delete a row from a ListView. So this is the xml that contains the ListView. Let it be in… 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 show two different DatepickerDialogs on same activity with only one listener function in android?

By | September 1, 2012

In android for each time picker Dialog we can associate with a dialog. So with this dialog and a global variable we can have any number of Dialog listeners. Here is the sample java code. This is the layout file – main.xml MyAndroidAppActivity .java Please leave your valuable comments on this post.

A Simple FlashLight Application.

By | July 20, 2012

Here is a simple Application on how to use flashlight in android. Now the layout file main.xml. AndroiManifest.xml file contents. Make sure to add the permissions. Download the android java source code from here. please leave your valuable comments on this post.

How to create a widget in android?

By | June 7, 2012

Hello everyone… Today I will show you how to create a simple widget in android? First create a new project and name it “Widget1” and name the activity “WidgetDemo1“. Actually we dont need the activity class here. You can delete it and delete the corresponding entry of it from the AndroidManifest file also. Now we… Read More »

How to create CustomProgressBar in android – Part 3?

By | May 23, 2012

Hello all… In my previous posts I have shown two methods to create custom progressbar in android. Check out these tutorials to find out how? 1. How to build a custom progressBar in android- Part 2? 2. Custom progressbar in android with text – part 3 Today in this post I will show you a… Read More »

How to create a Custom Toggle Button in android?

By | May 20, 2012

Hello everyone… In today’s tutorial I will show you how to create a custom toggle button in android. Often in our applications we don’t need a default toggle button, so I will show you how to change that to make a toggle button according to your need. First I will create a fresh project named… Read More »

Custom progressbar in android with text – part 3

By | May 18, 2012

Hello all…… I have posted two posts on how to customize a progressbar in android. 1. Custom Indeterminate progressBar for android? 2. How to build a custom progressBar in android- Part 2? Here is another one with update text on top of the progressbar. Here is how we start. After creating a fresh project create… Read More »

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 »