Here is a simple example in which we will download a font from google and set it to our textview. View the Demo here Layout Here is our layout. The Edittext is a autocomplete textview where we will load the font names to download. The font names are stored in values.xml Lets see the layout. Font Family names… Read More »
We do SQLite operations in Android by extending the SQLiteOpenHelper Class. I will create an Employee table with three fields id name company. I have a model class same as the database table Employee. Employee.java Lets see How we can do the CRUD (Create, Read, Update and Delete) Operations. CREATE We create a class that extends the SQLiteOpenHelper.… Read More »
We will go straight to the code. This is the layout containing the EditText and the Button.
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 the main.xml main.xml… Read More »
Hello all.. I have shown two other examples for creating a connection between android and php. But still users are finding difficulty in grasping it. These are other posts. Android phpMysql connection. Android phpmySQL connection redone. Here is one more post on this which is even more detailed. OK we will start now. First create a fresh project… Read More »
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 atleast two intents.… Read More »
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 the layout for… Read More »
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 android? 4. Android… Read More »
Hello all……. In todays post I will show you how to listen to an EditText input in Android. Often we need this in our applications. We implement this with the help of TextWatcher class. Here is the java code for this. Here I am checking whether the input value in the edittext is between 20 and 120 if… Read More »
Hello all… Today I will show you how to use preferences in android? First we will create preferences using Create a folder named “xml” inside the “res” folder and inside that create an xml named “preferences.xml”. Now create a java file named “PreferenceDemo.java” in your src folder and copy this code into it. Now in your main java… Read More »
We can create a dialog with custom alert dialog with our xml in android. But for making simple alerts we can make custom alerts through code itself. Here is a simple function for this. Here I am having a Listview and an edittext with two buttons in the alertBox. Please leave your valuable comments on this post.
Hello everyone In today’s tutorial I will show you how to filter a ListView based on an input from the EditText. This is really simple we just need to call getFilter().filter(search_string) on the adapter to filter the values from the ListViews. Just take a look at this example. Here is the layout file main.xml Here is the java… Read More »
This is a simple example to read a webpage content as a string in android. This example can also be used to get the response as a string when you make a call to a webpage. For example a php script. You can have a http script that will call a php script and get the response. Let… Read More »
Hello all…….. In today’s post I will show you send mail from an android application progrmatically.. Let’s go to the code fast…… This is the code in the mail java file…. Now the layout file (main.xml) The AndroidManifest.xml Note: However if you test this in your emulator, it will not work. Install it in your device to test… Read More »
This is a simple example showing email validation in ANDROID. This example uses regex for email validation. Create a button and an edittext in your main.xml file and try this code. Check this link to find how you can send email from android programatically. Please leave your valuable comments……