-1

I am newbie in android .i want to develop an application which has the username and password fields and a login button ,when i click the login button the username and password should be verified with the login name and password with the php function in database. can anyone of u pls provide me with the code..

i want to use the webserver.

1
  • 2
    with the php function in database? , Do you have local DB ? or somewhere on some webserver ? Commented May 25, 2011 at 6:07

3 Answers 3

0

You can use JSON as written above, but would be nice to use encoding on password when sending data...

If you use md5 encoding on your PHP server you should send md5 coded password to make it more simple...

I prefer this way... you make php file which reads $_GET parameters and is only for platform (u can detect platform on sever)... Than you can call URL by doing smth like this: http://yourserver.com/index.php?a=login&user=something&password=md5string... You can make a PHP file than to return JSON with data like loginOK = true / false, user's data (name, url to picture or whatever)...

Hope it helps!

Sign up to request clarification or add additional context in comments.

Comments

0

Depending on your needs there might be built in account managing support in Android.

I would perhaps start of by having a peek on the AccountManager. The following link would be a good start I think.

http://developer.android.com/reference/android/accounts/AccountManager.html

Comments

0

You can use JSON for it refer to this link: How to send a http request by JSON in Android?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.