title: Auto logging in to website through android webview problems
body: <p>My bank has a mobile site that I want to log into automatically. 
  This is the webpage <a href="https://ib.absa.co.za/ib/AuthenticateW.do?icmpid=BAC00414" rel="nofollow">https://ib.absa.co.za/ib/AuthenticateW.do?icmpid=BAC00414</a>.</p>
  
  <p>Here is my code so far.</p>
  
  <pre><code>    browser = (WebView)findViewById(R.id.webView1);
      browser.getSettings().setJavaScriptEnabled(true);
  
          ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);
          nameValuePairs.add(new BasicNameValuePair("AccessAccount", "my_account_nr"));
          nameValuePairs.add(new BasicNameValuePair("PIN", "my_pin"));
  
          try {
              browser.loadData(CustomHttpClient.executeHttpPost(BASE_URL, nameValuePairs), "text/html", "utf-8");
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <p>BASE_URL is the link at the top.  I got the CustomHttpClient from <a href="http://code.google.com/p/virtualwalks/source/browse/trunk/virtualwalks/project7/Android/CustomHttpClient.java?spec=svn177&amp;r=177" rel="nofollow">http://code.google.com/p/virtualwalks/source/browse/trunk/virtualwalks/project7/Android/CustomHttpClient.java?spec=svn177&amp;r=177</a></p>
  
  <p>Here is the webpage headers:</p>
  
  <blockquote>
    <p>Request URL:https://ib.absa.co.za/ib/AuthenticateW.do?icmpid=BAC00414</p>
    
    <p>Request Method:GET</p>
    
    <p>Status Code:200 OK</p>
    
    <p>Request Headersview source</p>
    
    <p>Accept:text/html,application/xhtml+xml,application/xml;q=0.9,<em>/</em>;q=0.8</p>
    
    <p>Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3</p>
    
    <p>Accept-Encoding:gzip,deflate,sdch</p>
    
    <p>Accept-Language:en-US,en;q=0.8,af;q=0.6</p>
    
    <p>Connection:keep-alive</p>
    
    <p>Host:ib.absa.co.za</p>
    
    <p>Referer:http://www.absa.mobi/</p>
    
    <p>User-Agent:Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F)
    AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1</p>
    
    <p>Query String Parametersview URL encoded</p>
    
    <p>icmpid:BAC00414</p>
    
    <p>Response Headersview source</p>
    
    <p>Cache-Control:no-cache, must-revalidate</p>
    
    <p>Connection:Keep-Alive</p>
    
    <p>Content-Encoding:gzip</p>
    
    <p>Content-Language:en-US</p>
    
    <p>Content-Type:text/html;charset=ISO-8859-1</p>
    
    <p>Date:Wed, 10 Oct 2012 07:57:50 GMT</p>
    
    <p>Expires:Sun, 12 Jul 1970 2:00:00 GMT</p>
    
    <p>Keep-Alive:timeout=10, max=20</p>
    
    <p>Pragma:no-cache</p>
    
    <p>Set-Cookie:JSESSIONID=0000CTls0Onsd_DJkBrN0FLy9eq:11l21e8a2; Path=/ib; Domain=absa.co.za;Secure</p>
    
    <p>Transfer-Encoding:chunked</p>
    
    <p>Vary:Accept-Encoding,User-Agent</p>
  </blockquote>
  
  <p>and the html code:</p>
  
  <pre><code>&lt;html&gt;
  </code></pre>
  
  <p>
          Absa Mobile Banking
      </p>
  
  <pre><code>&lt;body text="#000000" bgcolor="#FFFFFF"&gt;
      &lt;p align="left" style="text-align:left;" class="pgHeadTop"&gt;&lt;img src="/ib/images/wap/menu/absa_98x27.gif" alt="Logo" border="0"&gt; &lt;p align="left" style="text-align:left;" class="pgHeadBottom"&gt;Logon &lt;/p&gt;
  
          &lt;form action="https://vs1.absa.co.za/ib/AuthenticateW.do;jsessionid=0000CTls0Onsd_DJkBrN0FLy9eq:11l21e8a2" method="post" autocomplete="OFF"&gt;&lt;input type="hidden" name="_channelIdentifier_" value="W"&gt;
  
  
                  &lt;p align="left" style="text-align:left;"&gt;
                      &lt;p align="left" style="text-align:left;" class="tooltip"&gt;Enter your access account number&lt;/p&gt;
                      &lt;input type="text" name="AccessAccount" value="" maxlength="16" size ="16" istyle="4"&gt;
                  &lt;/p&gt;
  
              &lt;p align="left" style="text-align:left;"&gt;
                  &lt;p align="left" style="text-align:left;" class="tooltip"&gt;Enter your PIN&lt;/p&gt;
                  &lt;input type="password" name="PIN" value="" maxlength="5" size ="5" istyle="4"&gt;
              &lt;/p&gt;
              &lt;p align="left" style="text-align:left;"&gt;
                  &lt;p align="left" style="text-align:left;" class="tooltip"&gt;Enter your user number&lt;/p&gt;
                  &lt;input type="text" name="user" value="1" maxlength="4" size ="5" istyle="4"&gt;
              &lt;/p&gt;
              &lt;p align="left" style="text-align:left;"&gt;
                  &lt;p align="left" style="text-align:left;" class="heading"&gt;It is your responsibility to ensure the secrecy of your PIN number.&lt;/p&gt;
              &lt;/p&gt;
              &lt;p align="left" style="text-align:left;"&gt;
                  &lt;input type="submit" name="button_processPIN" value="Next &amp;gt;" /&gt;&lt;input type="hidden" name="processPIN_params" value="controller=com.sirius.apps.ib.view.wap.user.AuthenticateCntrl&amp;amp;state=processPIN"/&gt;&lt;input type="hidden" name="processPIN_encoding" value="u"/&gt;&lt;input type="hidden" name="cmd" value="button"/&gt;
              &lt;/p&gt;
              &lt;input type="hidden" name="AUTH_RND" value="a2f7ea6e"&gt;
              &lt;input type="hidden" name="JAVASCRIPT" value="Y"&gt;
              &lt;input type="hidden" name="LOGON" value="1"&gt;
          &lt;/form&gt;
          &lt;p align="left" style="text-align:left;" class="pageFooter"&gt;&lt;a href="https://ib.absa.co.za/ib/RegisterW.do;jsessionid=0000CTls0Onsd_DJkBrN0FLy9eq:11l21e8a2?_Uid_=1&amp;amp;_channelIdentifier_=W&amp;amp;_language_=en" style="color:#FFFFFF;"&gt;Register&lt;/a&gt; | &lt;a href="https://ib.absa.co.za/ib/ContactUsW.do;jsessionid=0000CTls0Onsd_DJkBrN0FLy9eq:11l21e8a2?_Uid_=1&amp;amp;_channelIdentifier_=W&amp;amp;_language_=en" style="color:#FFFFFF;"&gt;Contact&lt;/a&gt; | &lt;/p&gt;&lt;p align="right" style="text-align:right;" class="body"&gt;&lt;img src="/ib/images/wap/menu/barclays_84x25.gif" alt="Barclays" border="0"&gt;&lt;/p&gt;
  
  
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>If I run the program it just loads the login page.</p>
  
  <p>Just hoping someone could shed some light on this and if it's possible to do, or if my code is faulty/lacking/silly.</p>