ArhamTechMind

JSON

Networking with Volley in Android

Volley is a networking library for Android that manages network requests. It bundles the most important features you’ll need, such as accessing JSON APIs, loading images and String requests in an easier-to-use package. By using Volley for network operations you avoid the standard way to handle networking, HttpURLConnection. Another reason is asynchronicity. Volley handles asynchronicity by …

Networking with Volley in Android Read More »

JSON parsing and Displaying in ListView

1. manisfests.xml <uses-permission android:name=“android.permission.INTERNET”/> 2.mainActivity.xml <RelativeLayout xmlns:android=“http://schemas.android.com/apk/res/android”     xmlns:tools=“http://schemas.android.com/tools”     android:layout_width=“match_parent”     android:layout_height=“match_parent”     tools:context=“.MainActivity“>     <ProgressBar         android:id=“@+id/progressBar”         style=“?android:attr/progressBarStyleLarge”         android:layout_width=“wrap_content”         android:layout_height=“wrap_content”         android:layout_centerHorizontal=“true”         android:layout_centerVertical=“true”         android:visibility=“invisible” />     <ListView         android:id=“@+id/listView”         android:layout_width=“wrap_content”         android:layout_height=“wrap_content”         android:layout_alignParentLeft=“true”         android:layout_alignParentStart=“true”         android:layout_alignParentTop=“true” /> </RelativeLayout> 3.activity_detail <RelativeLayout xmlns:android=“http://schemas.android.com/apk/res/android”     xmlns:tools=“http://schemas.android.com/tools”     android:layout_width=“match_parent”     android:layout_height=“match_parent” …

JSON parsing and Displaying in ListView Read More »

JSON Example

JSON :- JavaScript Object Notation It contains key/value pairs Key-> Strings Values:->JSON {}   :-> JSON Object []    :-> JSON array Syntax : {“employees”:[    {“firstName”:“John”, “lastName”:“Doe”},    {“firstName”:“Anna”, “lastName”:“Smith”},    {“firstName”:“Peter”, “lastName”:“Jones”}]} package csdevbin.json; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import org.json.JSONObject; public class MainActivity extends AppCompatActivity {     public static final String JSON_STRING = “{“employee“:{“name“:“John“,“salary“:6000}}”;     @Override     …

JSON Example Read More »