tags:

views:

231

answers:

2

Hi,

I have a WebView. I'd like to show some page from my server, but I require some basic authentication. Is there a way I can specify basic auth credentials when calling WebView.loadData() somehow? I can do this on iphone with the equivalent webview class, thinking maybe same is possible with android?

Thanks

+1  A: 

You can call:

 setHttpAuthUsernamePassword (String host, String realm, String username, String password)

read more here

Pentium10
Cool that's pefect, thanks! If my url is like http://mysite.com/test, what would 'host' and 'realm' be? Host should be = 'mysite.com' ? Thanks
host should be the protected directory. The Realm information is an arbitrary string sent to be displayed to the user commonly containing a sight message, or feedback. Anyway is not used in this scenario.
Pentium10
also look into this http://www.mail-archive.com/[email protected]/msg30468.html
Pentium10
A: 

hi,

can you please tell me how did u do that on iphone... i need load a webpage from server on iPhone webview and it requires HTTP authentication with some userid and password.

can u please tell me how can i do this iphone?

chaithra
Start your own question, don't hijack this one.
theomega