Tag Archives: String

Class has not initialiser error in Swift – Solved.

By | August 14, 2017

Apart from other languages, when you write a class in Swift, It should have a initialiser. To solve this we have to write init() function in that particular class. Just like below. For example, look at the below class. Here we have 5 variables. The above error usually comes when you don’t initialize all variables… 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 »

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 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 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 »

JSON IN ANDROID.

By | April 26, 2012

Complex JSON String parsing in ANDROID http://www.coderzheaven.com/2011/06/10/complex-json-string-parsing-in-android/ Parsing JSON Object in ANDROID. http://www.coderzheaven.com/2011/06/09/parsing-json-objects-in-android/

How to read and write a text file that is stored in your application sandbox in ANDROID?

By | April 22, 2012

Hi all….. In this post I will show you how to read a text file in ANDOID. Let your file is in the your application sandbox of your ANDOID project, i.e the file’s location is /data/data/your_package_name folder. To view this folder -> open File Explorer and expand each folder. For this example to work first… 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.

Get characters in a string – C Sharp/C#

By | April 7, 2012

Hi, Sometimes you may need to get all the characters in a string using C Sharp/C#. The following code gives you an example of how to get or display all the characters of a given string. Output: sampleString[0] = I sampleString[1] = sampleString[2] = L sampleString[3] = o sampleString[4] = v sampleString[5] = e sampleString[6]… Read More »

Java check memory Allocation

By | April 7, 2012

When run the code the output will be similar to this Total memory is: 5177344 Initial free memory: 4986744 Free memory after garbage collection: 5063784 Free memory after allocation: 5045296 Memory used by allocation: 18488 Free memory after collecting discarded Integers: 5063784

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 »

Complex JSON String parsing in ANDROID

By | June 10, 2011

Hello all….. In the previous post I have shown you how to parse a Simple JSON String in ANDROID. In today’s tutorial I will show you how to parse a complex JSON String. Take a look at the example Here the JSON String used is Now let’s dothe operation……….. Please check the Logcat for the… Read More »

Parsing JSON Object in ANDROID.

By | June 9, 2011

JSON are alternative to XML and easy to understand than XML. As other languages Java also supports JSON parsing. Here is a simple example of JSON parsing in ANDROID. This is the JSON String that I am going to parse. And this JSON is same as this xml. Here is the code for this parsing.… Read More »

How to send email from and ANDROID Application programatically?

By | May 16, 2011

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

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 »

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 »

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 »