DataHandler needs to be used both for logging in and for managing passwords. To create an instance, call the constructor with 2 parameters. The first parameter is an instance of a SharedPreference, while the second parameter is the password used to login. Example:
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
DataHandler dH = new DataHandler(prefs, password);
Simply call setInitialUserPassword() with the password as a parameter.
To get the hash of the user's password, do the following:
String pwHash = CryptoHelper.hash(password);
When logging in we obviously want to compare the hash of the input password to the hash stored. To get the hash of the stored password, simply call getUserPassword() from your DataHandler object.
To change the login password, call setUserPassword() with the new password as the first parameter and the old password as the second.
To save a new managed password, call saveManagedPassword() with the "name" or key as the first parameter and the password as the second.
To delete a managed password, call deleteManagedPassword() with the "name" or key as the parameter.
To retrieve an arraylist of key value pairs of all managed passwords, call getAllManagedPasswords()