Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:00:46+00:00 2026-06-06T00:00:46+00:00

JSON Parser Class public class JSONParser { static InputStream is = null; static JSONObject

  • 0

JSON Parser Class

public class JSONParser {

    static InputStream is = null;
    static JSONObject jObj = null;
    static String json = "";

    // constructor
    public JSONParser() {

    }

    public JSONObject getJSONFromUrl(String url, List<NameValuePair> params) {

        // Making HTTP request
        try {
            // defaultHttpClient
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(url);
            httpPost.setEntity(new UrlEncodedFormEntity(params));

            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            is = httpEntity.getContent();

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    is, "iso-8859-1"), 8);
            StringBuilder sb = new StringBuilder();
            String line = null;
            while ((line = reader.readLine()) != null) {
                sb.append(line + "\n");
            }
              /*int i = 0,c; 
            while ((c = reader.read()) != -1) {
                sb.append((char)c);
                Log.d("test",String.valueOf(i++) + " " + (char)c);
            }*/
            is.close();
            json = sb.toString();
            Log.e("JSON", json);
        } catch (Exception e) {
            Log.e("Buffer Error", "Error converting result " + e.toString());
        }

        // try parse the string to a JSON object
        try {
            jObj = new JSONObject(json);
        } catch (JSONException e) {
            Log.e("JSON Parser", "Error parsing data " + e.toString());
        }

        // return JSON String
        return jObj;

    }
}

http://www.2shared.com/document/gH4zJsOO/log.html

sending data to MySQL databases

06-09 21:46:02.650: D/dalvikvm(315): GC_FOR_MALLOC freed 6777 objects / 323848 bytes in 87ms
06-09 21:49:11.980: W/System.err(315): java.net.SocketException: The operation timed out
06-09 21:49:11.990: W/System.err(315):  at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)
06-09 21:49:12.000: W/System.err(315):  at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115)
06-09 21:49:12.000: W/System.err(315):  at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:244)
06-09 21:49:12.010: W/System.err(315):  at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)
06-09 21:49:12.010: W/System.err(315):  at java.net.Socket.connect(Socket.java:1055)
06-09 21:49:12.020: W/System.err(315):  at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
06-09 21:49:12.030: W/System.err(315):  at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
06-09 21:49:12.030: W/System.err(315):  at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
06-09 21:49:12.040: W/System.err(315):  at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
06-09 21:49:12.050: W/System.err(315):  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
06-09 21:49:12.050: W/System.err(315):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
06-09 21:49:12.060: W/System.err(315):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
06-09 21:49:12.060: W/System.err(315):  at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
06-09 21:49:12.070: W/System.err(315):  at tn.pack.ordre.library.JSONParser.getJSONFromUrl(JSONParser.java:42)
06-09 21:49:12.080: W/System.err(315):  at tn.pack.ordre.library.UserFunctions.registerUser(UserFunctions.java:60)
06-09 21:49:12.090: W/System.err(315):  at tn.pack.ordre.EnregistrerActivity.onClickValider(EnregistrerActivity.java:49)
06-09 21:49:12.090: W/System.err(315):  at java.lang.reflect.Method.invokeNative(Native Method)
06-09 21:49:12.100: W/System.err(315):  at java.lang.reflect.Method.invoke(Method.java:521)
06-09 21:49:12.110: W/System.err(315):  at android.view.View$1.onClick(View.java:2067)
06-09 21:49:12.120: W/System.err(315):  at android.view.View.performClick(View.java:2408)
06-09 21:49:12.120: W/System.err(315):  at android.view.View$PerformClick.run(View.java:8816)
06-09 21:49:12.130: W/System.err(315):  at android.os.Handler.handleCallback(Handler.java:587)
06-09 21:49:12.140: W/System.err(315):  at android.os.Handler.dispatchMessage(Handler.java:92)
06-09 21:49:12.150: W/System.err(315):  at android.os.Looper.loop(Looper.java:123)
06-09 21:49:12.150: W/System.err(315):  at android.app.ActivityThread.main(ActivityThread.java:4627)
06-09 21:49:12.160: W/System.err(315):  at java.lang.reflect.Method.invokeNative(Native Method)
06-09 21:49:12.160: W/System.err(315):  at java.lang.reflect.Method.invoke(Method.java:521)
06-09 21:49:12.170: W/System.err(315):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-09 21:49:12.180: W/System.err(315):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-09 21:49:12.180: W/System.err(315):  at dalvik.system.NativeStart.main(Native Method)
06-09 22:13:27.330: E/Buffer Error(315): Error converting result java.lang.NullPointerException
06-09 22:13:27.360: E/JSON Parser(315): Error parsing data org.json.JSONException: End of input at character 0 of 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:00:49+00:00Added an answer on June 6, 2026 at 12:00 am

    The problem is with EasyPHP-5.3.9
    I change the version with EasyPHP-2.0b1
    and it works

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get json string from server. Then I parser it using SBJSON library. But
Say I have a JSON string like: {title:aaa,url:bbb,image:{url:ccc,width:100,height:200}, ... My accessor: import com.google.gson.annotations.SerializedName; public
I have a class public class ConversionResultModel { public string ProcessId { get; set;
Below is my json string, which i am trying to parse to list of
I have the following POJO class for a JSON object: public class JSONChangeSet {
I need a C++ JSON parser & writer. Speed and reliability are very critical,
I know that Android has a JSON parser baked in but I was wondering
I'm using the combination of json_encode (PHP) and JSON.parser (Javascript from json.org) for passing
I'm trying to implement JSON array iterator with Jackson SAX parser (please, don't ask
i have question about YAJLiOS parser... I have next json data : {{ body

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.