java - How to use "iHarder" base 64 encoder on android -


this base64 class :

http://iharder.sourceforge.net/current/java/base64/ 

the problem is, have 2 editext , 1 button in activity.so need use encode string edittext1 1 button , show result(encoded result) on edittext2.

how can , use class encode strings?

i read details class , cannot figure out how can use encode (input - output string in android)

how can ?

cheers!.

don't use third-party class in case - android has base64 class.

just use base64.encodetostring(byte[], int) , base64.decode(string, int).

note base64-encoding binary data, if actual source text, you'll need work out encoding use first... e.g. utf-8. example:

string sourcetext = ...; byte[] sourcebinary = sourcetext.getbyte(standardcharsets.utf_8); string base64 = base64.encode(sourcebinary, base64.default); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -