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 8710427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:37:25+00:00 2026-06-13T04:37:25+00:00

I have created a project for A User with Login Page. I need to

  • 0

I have created a project for A User with Login Page. I need to Login into the Application using jSON with PHP.

public class login extends Activity {
    EditText e1, e2;
    Button bt1, bt2;
    String s1, s2, Authendication;
    String S1,S2,u1[],p1[];
    String Uname;
    int i=0,j=0;
    Resources res;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
            e1 = (EditText) findViewById(R.id.userName);
            e2 = (EditText) findViewById(R.id.pwd);
            bt1 = (Button) findViewById(R.id.btLogin);
            bt2 = (Button) findViewById(R.id.btExit);
            res = getResources();

            DBConnect dc=new DBConnect(this);
            try {
                    SQLiteDatabase sqdb = db.getReadableDatabase();
                    Cursor c = sqdb.rawQuery("select UserID,password from User", null);
                     if (c != null) {
                        if (c.moveToFirst()) {
                            do {
                            S1=S1+","+c.getString(c.getColumnIndex("UserID"));
                            S2=S2+","+c.getString(c.getColumnIndex("password"));
                            i++;
                            } while (c.moveToNext());
                        }
                    }
                } catch (Exception e) {
            Toast.makeText(login.this, e.toString(), Toast.LENGTH_LONG).show();
    }
    bt1.setOnClickListener(new OnClickListener() {
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            int s = 0;
            String regex = "(,)"; 
            u1 = S1.split(regex);
            p1 = S2.split(regex);
            s1 = e1.getText().toString();
            s2 = e2.getText().toString();
            for (j = 0; j <= i; j++)
            {
                if((s1.equals(u1[j])) && (s2.equals(p1[j])))
                {
                    s=1;
                    Toast.makeText(login.this, "Login Successfully",
                            Toast.LENGTH_LONG).show();
                    Intent i1 = new Intent("My Next Screen");
                    startActivity(i1);
                }
            }   
            if(s == 0){ 
                    Toast.makeText(login.this, "Login fail",
                        Toast.LENGTH_LONG).show();
                }

        }
    });
    bt2.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            // TODO Auto-generated method stub
            e2.setText("");
            finish();
        }
    });
}
}

And My Xml File have 2 Edit Box and 2 Buttons. Can i perform these option with the PHP for Server Database with JSON..

Help me achieve this.

  • 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-06-13T04:37:26+00:00Added an answer on June 13, 2026 at 4:37 am

    Use the Following Methods for your’s coding..

     DefaultHttpClient httpClient = new DefaultHttpClient();
     HttpPost httpPost = new HttpPost(url);
     httpPost.setEntity(new UrlEncodedFormEntity(params));
     HttpResponse httpResponse = httpClient.execute(httpPost);
     HttpEntity httpEntity = httpResponse.getEntity();
    

    And use the following Link also..

    Android PHP connection through Java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a django application with a user login/registration page. I am trying to
I have just created a new project with a many-to-many relation (User-Group) and the
I am using qt 4.5 I have created a project and I want to
using VS 2008 i created a clean asp.net MVC application project and changed nothing
I am doing my project in struts2 and i have created the login pages
I have an AuthorizationServlet which is called when user click button in login page.
I've created a login system using PHP sessions. Here's how it works: 1.) when
I have created a MVC SenchaTouch project. I have created a sample application where
I have to create a tester program for a C project (codetester.c). The user
I have a project to create a program, which prevents the user from escaping

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.