Category Archives: ANDROID

Android: Conversion to Dalvik format failed: Unable to execute dex: null

By | April 28, 2011

This error often comes when your android project size is large. Try the following steps to remove the error 1. Clean the project Project > Clean 2. Increase the memory allocated in eclipse.ini Open the eclipse.ini file in the the Eclipse folder. Then edit -Xms128m to -Xmx512m or something higher Hope this help you

How to create and delete a directory in SdCard in ANDROID?

By | April 27, 2011

Hi all…… This is a simple example to create and delete a directory in ANDROID. Here the directly is created in the SDCARD. So first create an SDCARD and start the emulator with the SDCARD. Let’s look at the program. Use can use this program to create or delete a file in ANDROID also. main.xml… Read More »

How to place a label or textBox or anyother control inside a tableView in Titanium, ANDROID or iPhone ?

By | April 26, 2011

Hi all…….. This tutorial is for Titanium users. This tutorial explains how to place a textBox or anyother control inside a tableView. A tableview requires data in the form of a array, so we create an array (here array is named “data_array“) by adding the controls like textboxes and labels inside it. You can give… 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 »

How to get notified during an incoming call and get that number inside your program in ANDROID?

By | April 24, 2011

Hi all……. In today’s tutorial I will show you how to get the incoming phone number inside your application. In many situation we may need this. For this we need to have BoradCastReceivers. Inside this class we create an object of the TelephonyManager class ang register with the sytem service.Now we have to make another… Read More »

Android frame Animation

By | April 23, 2011

A series of frames is drawn one after the other at regular intervals. For this create a xml which contains ImageView for showing the animation The main java file is Next the main part, an xml which holds each image and duration in which each image shows. The xml should be placed inside drawable folder… Read More »

Android dialog with ListView

By | April 21, 2011

For implementing a ListView, we first create a xml which contains a ListView named list.xml Next we create a Dialog Object and inflate the above xml and when the listItem is clicked then a Alert Dialog windows comes The java file is listed below The alert window look like this When the Item is selected… Read More »

How to get the SMS sent to your emulator within your application? OR Get notified when an SMS arrives to your phone.

By | April 20, 2011

Actually these are done using services in ANDROID. These are called BroadcastReceivers.Your class has to extend the BroadcastReceiver class to get these broadcast events. But note that these services need to have an interface. So you will not see any UI on the device. But don’t think your application is not running or not installed.… Read More »

How to check SDCard free space in ANDROID?

By | April 19, 2011

This is a simple example that shows how many bytes are free in your SDCard. Inorder to run this example, you have to create an SDCard and start the emulator with the SDCard. Now create a fresh project and name it “FreeSpaceActivity.java” and copy the following code to it. The main.xml file AndroidManifest file Please… Read More »

SQLiteManager plugin for eclipse

By | April 18, 2011

When you are working on an Android application that stores data in a SQLite database.There arise many questions like where does this database file get stored on the filesystem ? How can we access the database? I will give solution to all these problems. I created the SQLite database from my previous post about Using… Read More »

How to use SQLite in ANDROID, A really simple example.

By | April 17, 2011

Hello ANDROID Lovers…….. In today’s tutorial I will show you how to deal with SQLite Databases in ANDROID. You know that SQLite are Lightweight databases which is maintained only on the client side. They don’t need a server. The SQLite databases are simply a file wrapped around with some stuff which helps us deal with… Read More »

How to use progress bar dialogs and custom Dialogs in ANDROID?

By | April 15, 2011

Hi, In most situations we have to use progress bar dialogs, Alert View Dialogs and Our own custom Dialogues in our applications. In most situations the built in dialogs may be enough but in certain other situations we have to build our own dialogs for better user experience. But still there is problem people don’t… Read More »

Applying a shape to xml in android

By | April 15, 2011

By adding a custom shape we can make the layout more attractive. For this we have to create a xml file and specify this in the main layout xml file First make a xml inside the drawable folder. Then in the main file specify this shape like this. The “category” is the name of the… Read More »

Simulating a call or SMS in your ANDROID Emulator – A simple Method

By | April 14, 2011

Hello all….. I have already covered this in another tutorial (click here for that post), but there I didn’t mention this method of simulating a call or SMS in android emulator. Let’s see how to do this… First start your emulator. Wait until it is Home. Then in Eclipse go to DDMS perspective. Look at… Read More »

How to detect shake in iPhone ? An example

By | April 13, 2011

Hi, Sometimes you may want to detect shake gesture in iPhone using your programs. But how can you detect shake gesture in iPhone? Shake gesture in iPhone can be detected by using the accelerometer. The following lines of code can be used for detecting the shake gesture in iPhone. You can use these lines of… Read More »

How to simulate an incoming call to an emulator OR Send an SMS to an emulator in ANDROID ?

By | April 12, 2011

Hello everyone…… Of course for the above question there are other ways to do it. This is one simple method Start two emulators and call each other, but the problem is it will be time consuming and memory will be consumed. Another method 1. First start your emulator and make sure it’s running. 2. Then… Read More »

How to remove box2D body from world ?

By | April 10, 2011

Hi, If you are a game developer and you are using box2D for real world simulations, you would probably need a particular body to be removed from the box2D world! But how can you remove box2D body from world ? See the following sample code which does the same. – (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {… 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 »

Text to speech in ANDROID, A Simple Example.

By | April 9, 2011

Hello everyone…….. In this simple example I will show you how to use Text To Speech in ANDROID. This is one of the unique features in ANDROID. Unlike iPhone , ANDROID has a built in TTS Library which supports many languages. But iPhone doesn’t have this feature. They have to depend on third-party software for… Read More »