title: Parsing in Android application
body: <p>I'm new in developing for android.</p>
  
  <p>I wrote JSON parse that parse information from site API by pressing button
  I need that program parse information automatically when Activity launches
  How I can do this?</p>
  
  <p>My code:</p>
  
  <pre><code> button.Click += async (sender, e) =&gt;
          {
  
              // Get the latitude and longitude entered by the user and create a query.
              string url = "http://new.murakami.ua/?mkapi=getProducts";
              JsonValue json = await FetchAsync(url);
              ParseAndDisplay (json);
          };
      }
          private async Task&lt;JsonValue&gt; FetchAsync (string url)
          {
              // Create an HTTP web request using the URL:
              HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create (new Uri (url));
              request.ContentType = "application/json";
              request.Method = "GET";
  
              // Send the request to the server and wait for the response:
              using (WebResponse response = await request.GetResponseAsync ())
              {
                  // Get a stream representation of the HTTP web response:
                  using (Stream stream = response.GetResponseStream ())
                  {
                      // Use this stream to build a JSON document object:
                      JsonValue jsonDoc = await Task.Run (() =&gt; JsonObject.Load (stream));
                  //dynamic data = JObject.Parse(jsonDoc[0].ToString);
                  //Console.Out.WriteLine("Response: {0}", jsonDoc[0].ToString);
  
  
                      // Return the JSON document:
                      return jsonDoc;
                  }
              }
          }
      private void ParseAndDisplay(JsonValue json) {
  
  
       ImageView product = FindViewById&lt;ImageView&gt;(Resource.Id.productimage);
          TextView name = FindViewById&lt;TextView&gt;(Resource.Id.posttitle);
          JsonValue firstitem = json[0];
          //Console.Out.WriteLine(firstitem["post_title"].ToString());
          name.Text = firstitem["post_title"];
  
  
     }
  </code></pre>