title: Performing login to https website via Android app
body: <p>First off, I'm pretty newb at this. I'm new to Android, to asp, to javascript, to http even.</p>
  
  <p>I'm trying to build an Android app that allows me to login to my school's website and pull data off it, ultimately I hope to do something like insert my timetable's data into Android's calendar entries. However I'm having trouble logging in.</p>
  
  <p>Here's the website:
  <a href="https://sso.wis.ntu.edu.sg/webexe88/owa/sso_login2.asp" rel="nofollow">https://sso.wis.ntu.edu.sg/webexe88/owa/sso_login2.asp</a></p>
  
  <p>What I'm doing currently is doing a http POST to the above-mentioned URL and I'm hoping to be redirected to hhttps://wish.wis.ntu.edu.sg/pls/webexe/aus_stars_check.check_subject_web2 which will display my timetable.</p>
  
  <p>So far my code is as follows after viewing the webpage's source and searching quite a bit on the Internet:</p>
  
  <pre><code>private void start_login(String[] array) {
      // TODO Auto-generated method stub
      Toast.makeText(this, "Logging in...", Toast.LENGTH_LONG).show();
  
      WebView wv = new WebView(this);     
      this.setContentView(wv);
  
      try {
  
          ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(4);
          nameValuePairs.add(new BasicNameValuePair("UserName", &lt;my username here&gt;));
          nameValuePairs.add(new BasicNameValuePair("PIN", &lt;my password here&gt;));
          nameValuePairs.add(new BasicNameValuePair("Domain", "STUDENT"));
          nameValuePairs.add(new BasicNameValuePair("p2", "https://wish.wis.ntu.edu.sg/pls/webexe/aus_stars_check.check_subject_web2"));
  
          wv.loadData(CustomHttpClient.executeHttpPost(URL, nameValuePairs), "text/html", "utf-8");
  
      } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
  }// end start_login
  </code></pre>
  
  <p>That's the login function.</p>
  
  <p>The CustomHttpClient I'm using is thanks to this guy: <a href="http://www.newtondev.com/2010/07/27/making-http-requests-using-google-android/" rel="nofollow">http://www.newtondev.com/2010/07/27/making-http-requests-using-google-android/</a></p>
  
  <p>So far I'm not getting any results. What am I doing wrong? Am I missing values in the ArrayList, or have I got the URL all wrong?</p>