1

I'm trying to make an application that needs authentication :- when user type username and pw in the text boxes it should check with the DB in the server and authenticate.

how can i do this in the android?

can please any one help me??

thank you,

  • So whats the issue in it?You can send asynchronous post request to server by encrypting uname and password and server can give you response? – Vipul Jun 17 '12 at 05:19

1 Answers1

2

If you are a web developer you can do this authentication very easily. You can follow the following steps,

  1. First, get the username and password from the user and put in the variables.
  2. Create the HTTP connection to the web server (Your data posting URL).
  3. Post the data to the URL with specified data using HTTP Get or Post method(Post is preferable for authentication)
  4. Get the posted value using server side script and do the authentication.
  5. send the response status to the client by using JSON encoding or some other format whether the authentication is succeeded of failure.
  6. Get the response in android and create the InputStream and decode the JSON or some specified encoding format which you done in the server side and shown the response in mobile.

Thats it.

Ranjit
  • 5,130
  • 3
  • 30
  • 66
Akilan
  • 1,707
  • 1
  • 16
  • 30