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 in the class… Read More »
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 PHP Script is… Read More »
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 layout for the… 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 »
This is a simple code. Check out this. PLease check the LogCat for the List of EMAIL ADDRESSES.
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 »
Java swing provides a native look and feel that emulates the look and feel of several platforms. Here i am going to create a Button and adding it to Frame. For this first create a Jframe object,a JPanel object and a Container object JFrame f = new JFrame(); JPanel panel1 = new JPanel(); Container con = f.getContentPane(); Then… Read More »
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/
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 push te file… Read More »
The following code simply allows you to select a date and time using the datepicker and timepicker in ANDROID.
Hi, Sometimes you may need to convert string to double using C#, see the following lines of code to see how you could do it. 🙂
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 = I sampleString = sampleString = L sampleString = o sampleString = v sampleString = e sampleString = sampleString =… Read More »
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
Concating one string to another in C# is just like java. ie. just by adding using “+” sign.
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. How to upload… Read More »
Hi, In order to find whether a given string starts with a particular string or not in JAVA, use the following code.
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 output. Please leave… Read More »
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. Please check the… 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 »
Hi, Sometimes you may need to check whether two strings are equal or not equal by checking case insensitive. See the example below to see how to achieve the same using C Sharp /C#. Output : heaven and HEAVEN are equal – Case Insensitive! 🙂
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 Now go to… Read More »
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 example I will… Read More »
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 then
Hi, Want to know how to insert a string at a particular position in C# ? See the following code. It will print- “Coderz Codes Heaven” 🙂