Skip to content

Instantly share code, notes, and snippets.

View gist:601260551560d9149d9a
package com.runningbus;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
View gist:471738699e74ea7ce5e8
package com.runningbus.get;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONException;
@johnsonyeap
johnsonyeap / gist:2da5f6410d33d20ef4a0
Created Aug 6, 2014
HTTP in doInBackground of AsyncTask
View gist:2da5f6410d33d20ef4a0
package com.runningbus.put;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
@johnsonyeap
johnsonyeap / Survey
Created Jul 16, 2014
This is an example exercising GET Method and POST Method in Android by using HttpURLConnection class.
View Survey
package com.mitgsl.johnsonyeap.androidassignment2;
import android.app.Activity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;