Ejemplo n.º 1
0
  private void saveData(String name, String pass) {

    shPrefEditor = shPreferences.edit();

    try {
      String nameToSave = Crypto.encrypt(SEED, name);
      String passwordToSave = Crypto.encrypt(SEED, pass);

      shPrefEditor.putString(NAME, nameToSave).commit();
      shPrefEditor.putString(PASSWORD, passwordToSave).commit();
    } catch (Exception e) {
      System.out.println("Saved Data Decrypt: " + e);
    }
  }
Ejemplo n.º 2
0
  private void getSavedData() {
    try {

      String savedName = Crypto.decrypt(SEED, shPreferences.getString(NAME, ""));
      String savedPassword = Crypto.decrypt(SEED, shPreferences.getString(PASSWORD, ""));

      eTuserName.setText(savedName);
      eTpassword.setText(savedPassword);

      //		System.out.println("Datas was become: "+savedName+", "+shPreferences.getString(NAME, ""));
    } catch (Exception e) {
      System.out.println("getSavedData Error " + e);
    }
  }