Monday, 28 December 2015

StringBuilder

StringBuilder StringBuilder class is used to create mutable(modifiable) string. The java Stringbuilder calss is same as Stringbuffer. StringBuilder is a non-synchronized. Its is available since JDK 1.5. Important constructors of StringBuilder Class: StringBuilder(): creates an empty string Builder with the initial capacity of 16. StringBuilder(String str): creates a string Builder with the specified string.    3.StringBuilder(int length): creates an empty string Builder with the     specified capacity...

Monday, 21 December 2015

StringBuffer

Java StringBuffer class    Java StringBuffer class is used to created mutable (modifiable) string. The StringBuffer class in java is same as String class except it is mutable i.e. it can be changed. Note: Java StringBuffer class is thread-safe i.e. multiple threads cannot access it simultaneously. So it is safe and will result in an order. Important methods of StringBuffer class: public synchronized StringBuffer append(String s): is used to append the specified string with this string. The append() method is overloaded like...

Thursday, 17 December 2015

Android - JSON Parser

JSON Parser JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML.  This chapter explains how to parse the JSON file and extract necessary information from it. Android provides four different classes to manipulate JSON data.  These classes are JSONArray,JSONObject,JSONStringer and JSONTokenizer. The first step is to identify the fields in the JSON data . In the JSON given below.  For example:  http://demo.codeofaninja.com/tutorials/json-example-with-php/index.php...

Sunday, 1 November 2015

Android Adapter

Android Adapter   Adapters are the link between a set of data and the AdapterView that displays the data. AdapterView: AdapterViews are ViewGroups that display child views given to it by an adapter.  An example of an AdapterView is a ListView.  Adapters also provide the child views that display the data in the AdapterView.  Adapters are responsible for supplying the data and creating the views representing each item.    Adapters...

List View

List View Listview is a view group that displays a list of scrollable items.  The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.    Example Coding: Activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"...