Thanks  Ian,
I have used this.
And I am getting Error Msg like this
"java.net.SocketException: Permission denied (maybe missing INTERNET
permission)"
How can I resolve it.
I am using Android 2.0 HVGA Emulator.

On Nov 6, 5:02 am, Ian Guedes Maia <[email protected]> wrote:
> /* makes a request andgettheresponseas string */
> String responseStr = null;
> HttpClient client = new DefaultHttpClient();
> HttpGet httpGetRequest = new HttpGet(url);
> HttpResponseresponse= client.execute(httpGetRequest);
> if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
>         ByteArrayOutputStream os = new ByteArrayOutputStream();
>        response.getEntity().writeTo(os);
>         responseStr = os.toString();
>
> }
>
> /* parse the stringresponseusing the androidJSONlibrary */
> JSONObjectjson= new JSONObject(responseStr);
> JSONObject feed = (JSONObject)json.get("feed");
> JSONArray entry = (JSONArray) feed.get("entry");
> int length = entry.length();
>
> 2009/11/5 mapper <[email protected]>:
>
> > Hi,
> > I am developing a application where I have topostthedatato the
> > server and it will give meJSONas aresponse.
> > So how can Ipostthedatato server andgettheJSONas aresponse
> > which I have to parse it?
>
> > Thanks in Advance
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
> > Topostto this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to