Provide 4-pin password protection to android app -


i add 4-pin password protection android app, in evernote app.. user should have option enable or disable password protection. have no idea start...

  1. layout: want 4 boxes accepts numbers.may using edittext option. i'm not quite sure keypad.

  2. password storage: using shared preferences work?

  3. how add option reset password? should make small webservice it? application doesn't use internet,more calculator. i'm using sqlite store data.

    could brief steps should follow? questions may silly, i'm new in android , i'm helpless. appreciate response. thank

you need 2 screens, 1 setting password, other opens everytime user opens app

  1. in first screen, use 4 edittexts horizontally custom background, make them rectangular in shape (one example this), set input type "numberpassword", open number pad , accept passwords.. limit number of characters in each edittext 1.. once user done entering value in edittexts, combine them.

    string pass= edittext1.gettext().tostring()+edittext2.gettext().tostring()+.. , on 

and store in sharedpreferences:

sharedpreference sp=getsharedpreference("password",pass); 
  1. make same layout in second screen , when user done entering value, again combine 4 , check 1 stored in sharedpreference.. eg:

    if(edittext1.gettext().tostring()+edittext2.gettext().tostring() +.. , on).equals(sp.getstring("password",""){        //intent main activity   }    else{    toast.maketext(getapplicationcontext(),"incorrect password",toast.length_long).show();   } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -