As a beginner, I got stuck a bit with Json disassembling on the link. The essence of the question is as follows. You need to get the exchange rates from this link https://api.privatbank.ua/p24api/exchange_rates?js ...
Wrote such code.
import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; public class JSONParser extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } static InputStream is = null; static JSONObject jObj = null; static String json = ""; String url = "https://api.privatbank.ua/p24api/exchange_rates?json&date=01.12.2014"; // constructor public JSONParser() { } public JSONObject getJSONFromUrl(String url) throws JSONException { JSONParser jsonParser = new JSONParser(); JSONObject object = jsonParser.getJSONFromUrl(url); String content=object.getString("currency"); // String content1 = getJSONFromUrl(url).getString("date"); // if (content1.equals(object)){ // JSONArray arrayClentHistoryRequest = getJSONFromUrl(url).getJSONArray("exchangeRate"); // for (int i=0; i<arrayClentHistoryRequest .length();i++) // { // Toast.makeText(arrayClentHistoryRequest.get(i).getString("currency"), Toast.LENGTH_LONG).show(); // } try { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); 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"); System.out.println(line); } is.close(); json = sb.toString(); } 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()); System.out.println("error on parse data in jsonparser.java"); } return jObj; } } In the comments code is written, which I think is needed somewhere here, although I could be wrong. And how to put all this in some sort of ListView? Json