Hi
Fares Askndaer :
I am developing an app in which I have to make a login form(which I
have made earlier and I have to code for further flow) and when user
fills his/her username and password,
then authenticate it through a webservice (built in ASP) and when
authentication is successfull then
display his/her personal detail, in a view. Would you like to help me
please. thanks a lot.

On Jan 20, 8:06 am, Fares Askndaer <asknd...@gmail.com> wrote:
> Hi
>
> I have built app that display asp pages using WebView but some of the
> page want theauthentication(Username ,Password ) tologinI want my
> application to autologinto this page using Username and Password
> from my Application
>
> This is my code Please Help
>
> public class eadvantage extends Activity {
>     /** Called when the activity is first created. */
> WebView mWebView; @Override public void onCreate(Bundle
> savedInstanceState) { super.onCreate(savedInstanceState);
> setContentView(R.layout.eadvantage);
>
>      HttpClient httpclient = new DefaultHttpClient();
>      HttpPost httppost = new HttpPost("http://www.ucsi.edu.my/
> advantage/new/main.asp");
>
>     try {
>         // Add your data
>         List<NameValuePair> nameValuePairs = new
> ArrayList<NameValuePair>(2);
>         nameValuePairs.add(new BasicNameValuePair("txtUserID",
> "12345));
>         nameValuePairs.add(new BasicNameValuePair("txtPassword",
> "12345"));
>         httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
>
>         // Execute HTTP Post Request
>         HttpResponse response = httpclient.execute(httppost);
>
>         mWebView = (WebView) findViewById(R.id.webview);
>         mWebView.getSettings().setJavaScriptEnabled(true);
>         mWebView.loadUrl("http://www.ucsi.edu.my/advantage/new/
> main.asp");
>
>         mWebView.setWebViewClient(new WebViewClient());

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to