Best FrameWork for JSON [closed]

-2

I have an android project and I need a framework to exchange information via webservice.

    
asked by anonymous 06.01.2015 / 02:21

1 answer

2

There is the Volley library maintained by Google that is intended to help implementations of HTTP communication.

Google provides a documentation page: link

Example usage:

public void initVolley(Context applicationContext) {
    mRequestQueue = Volley.newRequestQueue(applicationContext);
}

public void doPost(JSONObject jsonObject) {
    JsonObjectRequest request = new JsonObjectRequest(
        Request.Method.POST,
    URL,
    jsonObject,
    new Response.Listener() {
        @Override
        public void onResponse(JSONObject response) {
        // Do something...
        }
    },
    new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
        // Do something...
        }
    });
    mRequestQueue.add(request);
}
    
06.01.2015 / 04:54