-1

I have generated the key and secret now I don't know how to use the key and secret so that I can get the data from server into my Android app. Can anyone tell the the proper procedure of it? How can i Create the signature , nonce and other things t authenticate ?

1 Answers1

-1

Using Volley library is the easiest way to connect to APIs. For example

    RequestQueue queue = Volley.newRequestQueue(this);

    String url = this.apiURl; //you could store it as config at raw

    JsonObjectRequest jsonObjectRequest = new JsonObjectRequest
            (Request.Method.GET, url, null, new Response.Listener<JSONObject>() {

                @Override
                public void onResponse(JSONObject response) {

                // do nice things with your beautiful response 


            }, new Response.ErrorListener() {

                @Override
                public void onErrorResponse(VolleyError error) {
                    // Handle error if any 

                }
            });

    queue.add(jsonObjectRequest);

Woocommerce sends json response so use the JsonObjectRequestso you need not convert the String to Json again.

Hope this helps!

banstola
  • 47
  • 2