Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which methodsto use relavant code in my activity

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a login page in my application.So i am taking username and password.I saved password after md5 encryption.when user enters the username and password and click the submit button.Then i send the username to web service and get his password from database.them i match the password. SO i have below question

1)in which android method should i call the web service ?(On Create,On Pause.....)
2)which place use to convert given password to MD5?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1 - Most likely in the onClick handler of the login button, assuming that such a button exists. Frankly, if you think that either onCreate or onPause might be suitable then I think you have not grasped how the Activity lifecycle works.

#2 - Before making the WS call. Which other place did you consider?

Then i send the username to web service and get his password from database.them i match the password.

This is not good practice. You should design the WS call as the logical equivalent of method call "boolean checkLogin (String username, String hashedPassword)". There is no need to send any password -even hashed- from the backend to the app.

Also make sure that the WS is accessible via HTTPS only, and has the usual web app security measures in place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic