Hi!

Sorry for the late!

Now i am developing with the new SDK, and the classes i was using are
no longer available.

But i still facing some problem.

The error i am getting is "Unkown Error" and the logcat says:
"OSNetworkSystem unkown socket error -1"

The code is above:

        HttpClient client = new DefaultHttpClient();
        HttpGet get = new HttpGet("http://www.biocol.org/json/fetch/
lsid/urn:lsid:biocol.org:col:15670");
        try {
                HttpResponse httpResponse = client.execute(get);
                String res="";
                if(httpResponse.getStatusLine().getStatusCode()!=404){
                        res=
EntityUtils.toString(httpResponse.getEntity());
                }else
                        tv.setText("nothing found");
        } catch (Exception e) {
                tv.setText("fault: "+e.getLocalizedMessage());
        } finally {
                get.abort();
                get=null;
        }

Thanks!

On 9 set, 16:26, "Justin (Google Employee)" <[EMAIL PROTECTED]> wrote:
> Are you using the emulator behind a proxy? Can you load web pages in
> the browser? Can you provide the output from "adb logcat" when you try
> running this program?
>
> Cheers,
> Justin
> Android Team @ Google
>
> On Sep 4, 7:03 pm,CezarAugustus Signori <[EMAIL PROTECTED]>
> wrote:
>
> > Thanks for the response!
>
> > Well, i still getting no results... i am using the following:
>
> > <permission xmlns:android="http://schemas.android.com/apk/res/android";
> > android:name="android.permission.INTERNET"></permission>
>
> > and..
>
> > <uses-permission android:name="android.permission.INTERNET" />
>
> > something wrong or missing??
>
> > I am trying now to post data with RequestQueue, like the following:
>
> >         RequestQueue rQueue = new RequestQueue(this);
> >         Map<String, String> headers = new HashMap<String,
> > String>();
> >         headers.put("Content-Type", "text/xml");
> >         rQueue.queueRequest(URL, "POST",headers, new
> > MyEventHandler(),
> >                         new ByteArrayInputStream(POSTbytes),
> > POSTbytes.length,false);
>
> > where URL is the webservice url. The error i am getting is: "The URL
> > could not be found".
>
> > Any ideas?
>
> > On 3 set, 11:23, kennyg <[EMAIL PROTECTED]> wrote:
>
> > > Did you set the android.permission.INTERNET permission in the
> > > Android.Manifest.xml?
>
> > > Not providing this leads to unexpected errors when connecting.
>
> > > Kenny.
>
> > > CezarAugustus Signori wrote:
> > > > Hi all!
>
> > > > i still try to send/receive data from/towebservices...well, i tried
> > > > the kSoap2 (as almost of us), but all that i get is an "unknown error"
> > > > message.
>
> > > > After some tries, i've decided to simple send XML to thewebservice
> > > > through a connection and receive the response as String to later
> > > > handle it with some XML parser. But all i can get is a bug "Does Not
> > > > Support Output" message from the URLConnection. If i use another class
> > > > such HttpUrlConnection from java.net or apache,  the "unknown error"
> > > > message comes again.
>
> > > > I tried things like described:
>
> > > >http://www.anddev.org/calling_a_web_service_from_android-t348.html
> > > >http://chitgoks.blogspot.com/2008/03/android-and-web-services.html
> > > > and other resources from this group..
>
> > > > Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to