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

  • Home
  • SEARCH
  • 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 6058033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:33:14+00:00 2026-05-23T08:33:14+00:00

hey guys what I am trying to do is have two edit boxes for

  • 0

hey guys what I am trying to do is have two edit boxes for a user to sign into a website. I do not want to use a webview. my question is how can i get the inputted values from the editbox and put it in as their sign in info (i.e username and password) and return the result if it was successful or not?

Thanks again!

  • 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-23T08:33:15+00:00Added an answer on May 23, 2026 at 8:33 am

    I actually just wrote an app that did this exact thing. My first question is what technology are you using on the web side? For me it was asp.NET. You can use either a GET or POST method to send your user credentials and get your result. I suggest using POST since the information is sensitive and POST is better for that type of information. Here is the code.

    ASPX Code:

    string User = Request.Form["u"];
    string Pass = Request.Form["p"];
    Response.Write(ValidateUser(u, p));
    //I won't show you the validation code for security reasons.  But I think you get the idea.
    

    ANDROID CODE:

    public class LoginActivity extends Activity {
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.login);
    
            //Gets your login button and sets onClickListener
            Button btnLogin = (Button)findViewById(R.id.btnLogin);
            btnLogin.setOnClickListener(new View.OnClickListener() {
    
                public void onClick(View v) {
                    try {
                        //Get your TextBox from the layout
                        EditText etUserName = (EditText)findViewById(R.id.etUser);
                        EditText etPassword = (EditText)findViewById(R.id.etPass);
    
                        //Client to make the request to your web page
                        DefaultHttpClient myClient = new DefaultHttpClient();
    
                        //This is where you put the information you're sending.
                        HttpPost postUserCredentials = new HttpPost(getString(R.string.LoginAddress));
                        HttpEntity postParameters = new StringEntity("u=" + etUserName.getText() + "&p=" + etPassword.getText());
    
                        postUserCredentials.setHeader("Content-type", "application/x-www-form-urlencoded");
                        postUserCredentials.setEntity(postParameters);
    
                        HttpResponse postResponse = myClient.execute(postUserCredentials);
                        HttpEntity postResponseEntity = postResponse.getEntity();
    
                        String result = EntityUtils.toString(postResponseEntity);
    
                        if (result.equals("1")) {
                            Toast.makeText(this, "Login Succeeded", Toast.LENGTH_LONG).show();
                        } else {
                            Toast.makeText(this, "Login Failed", Toast.LENGTH_LONG).show();
                        }
                    } catch (Exception e) {
                        Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
                    }
                }
            });
        }
    }
    

    login.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent">
        <TextView android:id="@+id/tvUser" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Username:" />
        <EditText android:id="@+id/etUser" android:layout_width="match_parent" android:layout_height="wrap_content" />
        <TextView android:id="@+id/tvPass" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Password:" />
        <EditText android:id="@+id/etPass" android:layout_width="match_parent" android:layout_height="wrap_content" android:password="true" />
        <Button android:id="@+id/btnLogin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Login" />
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have created a tree which is not a binary tree. Now,
Hey guys i wrote a quick test. I want delete to call deleteMe which
Hey again guys. So, I'm trying to find out how to select every field
Hey guys, I have a GridView which is binded to SqlDataSource, everything works fine,
Hey guys, I have a raidan style 2d flying/fighter game that im working on.
Hey guys I am not able to pass the variable profile through... This is
Hey guys, so I have a team of iOS developers, who each are working
hey guys, i'm getting an exception on the following inner exception: {Value cannot be
Hey so what I want to do is snag the content for the first
Hey, I've been developing an application in the windows console with Java, and want

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.