Does anyone know how I would go about autofilling the username and password of a website on the browser in Android given that I have the login URL, the username and the password? Is there a simple way to do this or is somthing more complicated required? Thanks!
Asked
Active
Viewed 2,709 times
1 Answers
2
Use JavaScript :
String username = "cristian";
webview.loadUrl("javascript:document.getElementById('username').value = '"+username+"';");
So basically, what you have to do is a big string of JavaScript code that will get those fields and put values on them; also, you can enable/disable the submit button from JavaScript.
Source : Fill fields in webview automatically
-
2That's good to know but I was hoping for a generic solution which can be used for all websites where the ids of the password and username input fields vary. Any ideas? – timothyjc Feb 16 '12 at 01:52