Loshan Wickramasekara
Loshan Wickramasekara

Reputation: 109

android - build application to authenticate with web server

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,

Upvotes: 1

Views: 1694

Answers (1)

Akilan
Akilan

Reputation: 1717

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.

Upvotes: 2

Related Questions