Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.IOException;

import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;

import android.net.ParseException;

public class Main {
    public static String getStringResponseData(HttpResponse httpResponse) throws ParseException, IOException {
        if (httpResponse == null) {
            return "httpResponse is null!";
        } else if (httpResponse.getEntity() == null) {
            return "httpResponse entity is null";
        } else {
            return EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
        }
    }
}