OK, problem solved.
If I specify authorization in the HTTP header, something like:
httpConnection.setRequestProperty("Authorization", "Basic " +
Base64.encode("username:password"));
then I can skip the Authenticator class alltogether. This approach works both
for my traditional Java program
as well as my Android program.
Using the Authenticator approach in the traditional Java program works
(apparently) because the
transmission is done *twice*: when authorization is missing (from the HTTP
header) in the first call,
the transmission is done a second time, after first accessing the Authenticator
instance.
I am not an expert at this low level, but it seems like I may inherit some
connection properties from the
environment, and that these properties are different on the two platforms.
Thanks for all contributions.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en