Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
HttpClient, URLConnection, settings, etc...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jasp182  
View profile  
 More options Oct 9 2008, 6:54 am
From: Jasp182 <Jasp...@gmail.com>
Date: Thu, 9 Oct 2008 03:54:30 -0700 (PDT)
Local: Thurs, Oct 9 2008 6:54 am
Subject: HttpClient, URLConnection, settings, etc...
I have tried to call out to the web using both HttpClient and
URLConnection, and I get "unknown error" in both cases at the point
the call is actually made (HttpClient.execute() or
URLConnection.getContent() methods).  My emulator is able to connect
to the web, because I can use the Browser with no problem.  So, I'm
assuming that there aren't any issues with my settings (this is being
done on my home network with no proxy server).  Is there a "best
practices" preference between using HttpClient or URLConnection, and
are there any examples or sample apps (with source code) that make
simple calls to the web?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amos  
View profile  
 More options Oct 10 2008, 8:01 am
From: Amos <amosyo...@gmail.com>
Date: Fri, 10 Oct 2008 05:01:53 -0700 (PDT)
Local: Fri, Oct 10 2008 8:01 am
Subject: Re: HttpClient, URLConnection, settings, etc...

Make sure you have the "android.permission.INTERNET" Uses Permission
in your AndroidManifest.xml file to enable your app to access the
internet.

I don't know of any preference between HttpClient and URLConnection
(I'd also be happy to know if one of them is preferred).

There's an apps-for-android project which contains app samples created
by Google's Android team. I haven't examined them in-depth, but I'm
sure they have some pretty good usage examples. From just a quick
browse, this class might be a useful reference for you:

http://code.google.com/p/apps-for-android/source/browse/trunk/Transla...

Good Luck,
Amos

On Oct 9, 12:54 pm, Jasp182 <Jasp...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guillaume Perrot  
View profile  
 More options Oct 10 2008, 8:08 am
From: Guillaume Perrot <guillaume.p...@gmail.com>
Date: Fri, 10 Oct 2008 05:08:13 -0700 (PDT)
Local: Fri, Oct 10 2008 8:08 am
Subject: Re: HttpClient, URLConnection, settings, etc...
What are you trying to do ?
Can you post your code ?
For the HttpClient usage, there are several examples at
http://hc.apache.org/httpcomponents-client/examples.html

I have no best practice for you but concerning my usage:
* I only use HttpClient when I need to handle cookies.
* For REST API calls, I use URLConnection which is quite simple.

On Oct 9, 12:54 pm, Jasp182 <Jasp...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Proctor  
View profile  
 More options Oct 10 2008, 3:03 pm
From: Jason Proctor <ja...@redfish.net>
Date: Fri, 10 Oct 2008 12:03:01 -0700
Local: Fri, Oct 10 2008 3:03 pm
Subject: [android-developers] Re: HttpClient, URLConnection, settings, etc...
ensure that <uses-permission> is inside <manifest>, too, not inside
<application>.

i've had problems using URLConnection directly - with short transfers
i could reproducibly get "SOCKETLOG add_recv_stats 0" log error
messages, accompanied by nothing being delivered to the Android app.
i switched to using Socket or HttpClient, and everything worked fine.
URLConnection should work though IMHO.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google