This sets the default Authenticator and will be used in all requests. Obviously the setup is more involved when you don't need credentials for all requests or a number of different credentials, maybe on different threads.

Alternatively you can use a DefaultHttpClient where a GET request with basic HTTP authentication would look similar to:

You might want to switch to HttpURLConnection. According to this article its API is simpler than HttpClient's and it's better supported on Android. If you do choose to go with HttpURLConnection, authenticating is pretty simple:

You can use the built-in HttpURLConnection class to talk to a restful service. That class also supports https urls, which provide you with SSL encryption. For the authentication, you can use the built in mechanisms.

For Username+Password or Digest auth, you can just use the java.net.Authenticator, that you may need to extend like this: