Tag Archives: Import Java

Uploading Image to Server – Android Eclipse Version.

By | February 18, 2016

Hi all, In today’s tutorial I will show you how to send an image to server using POST method in ANDROID. If you are working in Android studio, then checkout the article here. Uploading an image to server is a basic requirement in many of our application. Sending data to server which is using a… Read More »

Multiple Selection GridView in Android

By | April 26, 2013

This is a simple post that helps you to do multiple selection in a ListView. Check out previous posts for 3D animation in a Listview. At first we will see the XML layout file. This layout contains a gridview since we are dealing with it only. grid_1.xml Now the MainActivity that does all the work… 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 call a function using a String in Android and also pass parameters along with it.

By | December 5, 2012

Hi all … Today’s post is all about calling functions using Simple Strings. Here we will do two things. 1. Call a function without parameters. 2. Call a function with parameters. This is the class which contains the functions that we are going to call using “simple Strings”. Now this is the main activity that… 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 to use NumberFormat Class in Android? – Rounding a number in android, formatting, getting decimal values etc in android.

By | October 14, 2012

How to get table values from a MySQL database and show it in Android as Tables.?

By | September 25, 2012

Here we are accessing a mysql database and get the table values and show it in the Android side as tables. These are some tutorials that I have posted on connection with php and getting tablevalues. 1. Android phpmySQL connection redone. 2. Simplest Lazy Loading ListView Example in Android with data populated from a MySQL… Read More »

Simplest Lazy Loading ListView Example in Android with data populated from a MySQL database using php.

By | September 23, 2012

Hello all… You may have seen many implementations of Lazy Loading ListView. Today I will show you my method to create Lazy Loading ListViews. I dont know whether it can be any more simple than this. In this I am using AsyncTask to download each image. So we will start. Here we have 6 classes.… Read More »

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.

How to load an image from the assets folder in android?

By | August 9, 2012

Here is a simple example showing how to load an image stores in assets folder in android? Done.

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 add a new contact programmatically in android?

By | June 18, 2012

We all know how to add a new contact to our android devices without programming right. OK that’s a normal man’s use. But what from a programmer’s view. This is the sample java code that helps you to add contact programatically. After running this programs please switch to contacts application on your device to see… 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 »

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 »

Date and TimePicker in ANDROID.

By | April 12, 2012

The following code simply allows you to select a date and time using the datepicker and timepicker in ANDROID.

Copying an image to another in ANDROID.

By | April 7, 2012

Here is a simple example to copy an image to another image file in ANDROID. In this example a button click will open the gallery and after that it will be copied to another image file. You have to check the File-explorer to find the file. This is the java code for doing it. here… Read More »

Uploading audio, video or image files from Android to server

By | March 29, 2012

Hello everyone, Check out the popular posts from Coderzheaven.com Uploading and Downloading of files – Popular and Useful posts from CoderzHeaven In one of the previous posts I have shown one method to upload an image in android. Here is another method to upload a media file like images,audio or video in android. Here is… Read More »

How to use Calendar in Android?

By | March 5, 2012

Hello all……. In today’s post I will show you how to use Calendar in android. Actually it is really easy to use calendar in android. For that android provides a calendar widget. We use calendar class to show the Calendar widget. Here is the java source code for this example. This is the main.xml for… Read More »