title: need help android Json Currency Converter
body: <p>I have a project that ask me to build a currency converter, i already search google and got some source that can give me a reference
  but i got stuck when i click calculate it doesnt change the textview to the rate of the currency.. </p>
  
  <p>I using a json and this is the site</p>
  
  <pre><code>http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22USDSGD%22%29&amp;format=json&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;callback=
  </code></pre>
  
  <p>this is some of the code</p>
  
  <pre><code>    calculate.setOnClickListener(new OnClickListener(){
      public void onClick(View v) {
           TextView texts = (TextView) findViewById(R.id.textView3);
  
          try {
          s = getJson("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22"+val[from]+val[to]+"%22)&amp;format=json&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;callback=");
          JSONObject jObj;
          jObj = new JSONObject(s);
          String theResult = jObj.getJSONObject("query").getJSONObject("results").getJSONObject("rate").getString("Rate");
  
           texts.setText(theResult);
          } 
  
          catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          }
          catch (ClientProtocolException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          }
          }
          }
  </code></pre>
  
  <p>the val[from]+val[to] is come from my spinner, i have 2 spinner</p>
  
  <p>the getJson code</p>
  
  <pre><code>     public String getJson(String url)throws ClientProtocolException, IOException {
              StringBuilder build = new StringBuilder();
              HttpClient client = new DefaultHttpClient();
              HttpGet httpGet = new HttpGet(url);
              HttpResponse response = client.execute(httpGet);
              HttpEntity entity = response.getEntity();
              InputStream content = entity.getContent();
              BufferedReader reader = new BufferedReader(new InputStreamReader(content));
              String con;
              while ((con = reader.readLine()) != null) {
              build.append(con);
              }
              return build.toString();
              }
  </code></pre>
  
  <p>please help me.. where is the wrong of this code i already try to edit and got nothing .. still when i click the button it dont give me the value to textview</p>