I have to encrypt a String but the app doesn\'t reach the encrypt method, it crashes on load.
I\'m using Apache Commons Codec library.
private EditText txt
Simply create an object of Base64 and use it to encode or decode in Android, when using org.apache.commons.codec.binary.Base64 library
Base64 ed=new Base64();
String encoded=new String(ed.encode("Hello".getBytes()));
Replace "Hello" with the text to be encoded in String Format.
Base64 ed=new Base64();
String decoded=new String(ed.decode(encoded.getBytes()));
Here encoded is the String variable to be decoded