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 for the multiple… Read More »
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 example to customize… Read More »
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 on this post… Read More »
I have already shown some examples with ActionBar. This is the example showing how to start with ActionBar in android. 1. Android removes the need of Menu button from devices with ActionBar. 2. How to start with ActionBar in Android? 3. Dynamically Adding, Removing, Toggling and Removing all ActionBar Tabs in Android – Part 2? Now today I… Read More »
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 resolving all that… Read More »
This sample application does that. First create an xml for your notification. custom_notification.xml Now the java code.
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.
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 permission in the… Read More »
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.
With Android 3.0 Google eliminated the need of hardware menu button which is replaced by Action Bars. Here is a quick example on how to use ActionBars. First create a new project and name it ActionBarExample. Now create a folder named “menu” in res folder and create a new XML file inside it named “action_bar_menu.xml”. action_bar_menu.xml Now the… Read More »
This is really simple in android. TextViews has a property called “lineSpacingExtra” which you can change to set the line spacing. OR you can call textView.setLineSpacing() in the java code itself.
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 the result. Please… Read More »
Hello everyone… In this post I will show you how to listen to hardware button in an android smartphone. This post especially shows how to listen to the home button in android. But my advice is never override the home button in your app. Home button is to move the currently running process to background. But you can… Read More »
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.
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 custom progressbar showing… Read More »
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 refer this. 1.… Read More »
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 request along with… Read More »
Hello all.. This simple example will show you how to change the hint text color in android Here is the java code to simply do this. here is a sample project to view the difference. This is the contents of the main java file. The main.xml file Here I am setting a read color to the second edittext… Read More »
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 is the main.xml… Read More »
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 it main.xml See… Read More »
Here is a simple example to show two listviews horizintally in android. here is the java code that sets up the list. Here is the main.xml file. Here is the layout for each row in the list . Here is the complete source code for this example.
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
Hello everyone Today I will explain how will you call a function that is defined inside the java android code from a webview. For this we need to add a webviewclient in android for the WebView we are adding in the xml. Then we have to register the webviewclient with the WebView we are creating using this method.… Read More »
In the previous example I showed how to parse an xml that is stored in a file in res/xml folder. In this post I will show you how to parse an xml that is stored in a server in an xml file. Here I am using an xml that is stored in here Here is the java code… Read More »