I need a simple java example of processing a JSON response via HTTP for Android App?

前端 未结 3 1551
逝去的感伤
逝去的感伤 2021-01-16 05:15

I am writing a simple Android app and have a database that will send back information into the app. I am new to Android and am looking for a simple example that demonstrates

3条回答
  •  深忆病人
    2021-01-16 06:08

    I wrote a small library project (stepsdk) and demo here, on making a GET request and process the json here.

    It is as simple as follows:

    new APIRequest(new APIManager(this), SERVER_URL+"/method", APIRequest.GET)
      .addParam('param', 'value')
      .start(new JSONRequestHandler(){
          @Override
          public void after() {
            JSONObject json = getResponse();
            // use json
          }
      });
    

    hope it helps.

提交回复
热议问题