Tag Archives: ArrayList

Using SmsManager to send SMS

By | March 1, 2017

There are two ways to send SMS in Android Using SmsManager Using Built in Intent 1. SmsManager The SmsManager manages SMS operations such as sending data to the given mobile device. You can create this object by calling the static method SmsManager.getDefault() as follows: Initialize Sending Message Once you have SmsManager object, you can use… Read More »

Using GSON in Android – Simple Demo

By | January 19, 2017

GSON is open source Java library developed by Google. It is an API for converting a Java object to json representation and viceversa. Uses Converts any Java object i.e new object or any existing/legacy object, to JSON and vice-versa. Finest support for generic objects Simple, convenient methods for conversions No need of any annotation for… Read More »

CRUD Operations in SQLite using SQLiteOpenHelper – Android

By | June 26, 2016

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… Read More »

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 »

Faster Loading images in GridViews or ListViews in Android using Menory Caching, Complete implemenation with sample code.

By | September 1, 2013

Hi all This example shows you how to load large images in the gridview without any lag or without outofmemory error. This sample application uses the LruCache to hold the images. A cache that holds strong references to a limited number of values. Each time a value is accessed, it is moved to the head… Read More »

What is a Memory Heap Size in android? and how can use Bitmap Efficiently?

By | August 25, 2013

Memory Heap Size Android is a full multitasking system so it’s possible to run multiple programs at the same time and obviously each one can’t use all of your device memory. For this reason there is a hard limit on your Android application’s heap size: if your application needs to allocate more memory and you… 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 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 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 Sort a String array in Android.

By | February 25, 2012

Hello all…. This is a simple example showing how to sort a string array which is a arraylist in android. we sort the array using the “Collections” class in android. Here is a simple example Take a look at the LogCat for the output.

Parsing an XML from Online in Android

By | December 25, 2011

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… Read More »

How to Upload Multiple files in one request along with other string parameters in android?

By | August 16, 2011

Hello everyone, I have shown two methods to upload files in android. In today’s tutorial I will show another simple method to upload files. With this method you can upload multiple files in one request + you can send your own string parameters with them. Here is another method on working with uploading of images.… Read More »

Android phpmySQL connection redone.

By | July 27, 2011

Hi all.. Most of our visitors had problem with one of our previous post on Android-php connection. So here I am posting another simple example to connect with a php file. Here I am simply putting an echo in the php file which ehoes back the data from the android side. Here are the things… Read More »

Listening incoming sms message in Android

By | May 1, 2011

When a new sms message is received by the device, a Broadcast Receiver is registered. For this IntentFilter filter = new IntentFilter(SMS_RECEIVED); registerReceiver(receiver_SMS, filter); should be included . Also sms are sent in PDU’s(Protocol Description Units) format, which act as an encapsulation. Inorder to extract from PDU to byte array messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]); method… Read More »

ANDROID – Upload an image to Server in Android Studio

By | April 25, 2011

Hi all, In today’s tutorial I will show you how to send an image to server using POST method in ANDROID. Uploading an image to server is a basic requirement in many of our application. Sending data to server which is using a PHP Script is already explained in this example . Now in this… Read More »

Expandable ListView in ANDROID using SimpleExpandableListAdapter, a simple example.

By | April 10, 2011

Hi all…… Here is a simple example of expandandable ListView in ANDROID. But I am not going to explain any code, because everything is explained inside the java file. Make sure to read it. The main.xml file. The child_row.xml The group_row.xml The strings.xml (This file contains the string for the color that is used for… Read More »

Make your own gesture application in ANDROID or How to use gestures in ANDROID?

By | April 5, 2011

Hi all…. In this tutorial I will teach you how to make use of Gestures in ANDROID and make your own application. Follow the below steps exactly to get an idea of how to use gestures. 1. Make a gesture Library. 2. Add your own gestures into it. 3. Export it to your applications and… Read More »