Android Open Source - tribunaldroid Http Get Task






From Project

Back to project page tribunaldroid.

License

The source code is released under:

GNU General Public License

If you think the Android project tribunaldroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package hu.nxu.tribunaldroid.networkComm;
/* w  w w.j a va2s. c o m*/
import android.app.Activity;
import android.os.AsyncTask;

public class HttpGetTask extends AsyncTask<String, Byte, String> {
  protected Activity callingActivity;
  
  /**
   * Initializes a new instance of the HttpGetTask class.
   * @param callingActivity The instance of the calling activity.
   */
  public HttpGetTask(Activity callingActivity)
  {
    this.callingActivity = callingActivity;
  }
  
  @Override
  /**
   * Performs an asynchronous HTTP(S) GET request.
   */
  protected String doInBackground(String... urls) {
    ConnectionManager cm = ConnectionManager.getInstance();
    
    try {
      return new String(cm.get(urls[0]), "UTF-8");
    } catch (Exception e) {
      return "#ERROR: " + e.getClass().getName();
    }
  }
  
}




Java Source Code List

hu.nxu.tribunaldroid.LoginActivity.java
hu.nxu.tribunaldroid.networkComm.ConnectionManager.java
hu.nxu.tribunaldroid.networkComm.CookieCollection.java
hu.nxu.tribunaldroid.networkComm.Cookie.java
hu.nxu.tribunaldroid.networkComm.GetCaptchaTask.java
hu.nxu.tribunaldroid.networkComm.HttpGetTask.java