Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6130987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:55:19+00:00 2026-05-23T16:55:19+00:00

I have to create a login page in android( username and password ) and

  • 0

I have to create a login page in android(username and password) and have to verify this login by sending (username and password) to a a url.Does someone know how could I do this??If u could provide me a bit of code it would be great!

UPDATE:Can someone tell which is the proper way to do a http post and request/????

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:55:20+00:00Added an answer on May 23, 2026 at 4:55 pm

    Try this

        public class Login extends Activity {
     /** Called when the activity is first created. */
    
    
     private static final String SOAP_ACTION = "http://tempuri.org/LoginUser";
     private static final String METHOD_NAME = "LoginUser";
     private static final String NAMESPACE = "http://tempuri.org/";
     private static final String URL = "http://";
     private static final String TAG = "HELLO";
    
     @Override
    public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
    Button signin = (Button) findViewById(R.id.regsubmitbtn);
    
    
    
           signin.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
    
        new StartLoginAsyncTask(yourclass.this).execute();
    
    
        }
     });
      }
    
    
       private class LoginTask extends AsyncTask<Void, Void, Boolean> {
       private final ProgressDialog dialog = new ProgressDialog(YourClass.this);
    
       protected void onPreExecute() {
         this.dialog.setMessage("Logging in...");
         this.dialog.show();
      }
    
       protected Boolean doInBackground(final Void unused) {
         return Main.this.login(); //don't interact with the ui!
      }
    
            protected void onPostExecute(final Boolean result) {
           if (this.dialog.isShowing()) {
                this.dialog.dismiss();
              }
                 if (result.booleanValue()) {
                 //also show register success dialog
             }
          }
               }
    
    
    
    
                private String doLogin() {
                    EditText etxt_user = (EditText)findViewById(R.id.emaileditlog);
                    String email_id = etxt_user.getText().toString();
                    EditText etxt_password = (EditText)findViewById(R.id.pwdeditlog);
                    String password = etxt_password.getText().toString();
                               SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
                               request.addProperty("email", email);
                                  request.addProperty("password", password);
    
                                 SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                    soapEnvelope.dotNet = true;
                    soapEnvelope.setOutputSoapObject(request);
                    HttpTransportSE aht = new HttpTransportSE(URL);
    
                     Pattern EMAIL_ADDRESS_PATTERN =Pattern.compile(
                             "[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" +
                             "\\@" +
                             "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
                             "(" +
                             "\\." +
                             "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
                             ")+");
                     Matcher matcher = EMAIL_ADDRESS_PATTERN.matcher(email_id);
                     if(matcher.matches()){
                      Log.v(TAG, "Your email id is valid ="+email_id);
                    //  System.out.println("Your email id is valid ="+email);
                     }
                     else{
                   //  System.out.println("enter valid email id");
                      Log.v(TAG, "enter valid email id" );
                     }
                     if (password != null) 
                        {
                         if(email_id.equalsIgnoreCase("")||password.equalsIgnoreCase(""))   
                        {
                       System.out.println("Fields should not be EMPTY");
                      }
                        }
    
                SoapObject request = new SoapObject(NAMESPACE_LOGIN, METHOD_NAME_LOGIN);
                request.addProperty("email", email_id);
                request.addProperty("pwd", password);
    
    
    
                      SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                soapEnvelope.dotNet = true;
                soapEnvelope.setOutputSoapObject(request);
                HttpTransportSE aht = new HttpTransportSE(URL_LOGIN);
    
              try {
                       aht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 
                 aht.call(SOAP_ACTION_LOGIN, soapEnvelope);
    
                 SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;
                 Log.v("TAG", String.valueOf(resultsRequestSOAP));
    
                Object response=(Object)soapEnvelope.getResponse();
                temp=response.toString();
    
    
    
                } catch (Exception e) {
    
                 e.printStackTrace();
                }
    
            return(temp);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code : def create login(params[:email], params[:password]) if current_user flash[:notice] = Welcome
I'm creating a login page. I want to create ASP.NET TextBox controls that have
I have this authnav='<li class=last><a href=auth/login>login</a></li>'+ '<li><a href=auth/create_account>create account</a></li>'; It works fine in Firefox,
I have used the following steps to create a login page. 1> create the
i have created a login page for some application in android and i want
I have tried to login my server with some fields like username, password, latitude,
I m trying to create a new register and login page. I have a
i am new to android and i have created a login page after verifing
I have created login page forced login in several pages. Now i need to
I have created a user login page and am using Forms Authentication. Users are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.