I searched the Internet for a way to do this for about a week, and I just can't figure it out.
I am trying to implement an application that my college can use so that users can easily log in to various services on campus. How it works now, they go to the online portal, choose which service they want, fill in their username and pwd and click on the login. The form data is sent by mail (it includes several hidden values, as well as only the username and pwd) in the corresponding login script, which then signs them and loads the service.
I tried to solve the problem in two ways. I tried WebView at first, but it doesn't seem to want to support all the html that usually does this form of work. I get all the necessary elements, fields for the user and pwd, as well as the login button, but pressing the button does nothing. I was wondering if I need to add an onclick handler for it, but I donβt see how this button is implemented in the html of a web browser without using a separate Android element.
Another possibility was to use xml widgets to create the form in a good relative layout, which seems to load faster and looks better on the Android screen. I used EditText fields for input, spinner widget for service selection and button widget for login. I know how to make onclick and item handlers for the button and spinner, respectively, but I canβt figure out how to send this data via POST in the intention that the browser would then launch. I can make an intent with the action url, but I can not get the POST data into it.
So here is what I have right now ...
HttpParams params = new BasicHttpParams(); HttpClient client = new DefaultHttpClient(params); HttpPost post = new HttpPost(action); String endResult = null; try { post.setEntity(new UrlEncodedFormEntity(myList)); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { String response = client.execute(post, new BasicResponseHandler()); endResult = response; } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
So now my question is ... how do I get the endResult screen, which should be returned after I log in to my service and display it in the browser?
source share