• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

which methodsto use relavant code in my activity

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic