I've placed javascript file in asset folder. How to call javascript function on click of button in activity. I need to show encrypted and decrypted text returned by js function in TextView so don't want to use webview. Please give me solution either for webview as well if its the only possibility.
Here is code for my js file
function encrypt(string, key, iv){
var key = CryptoJS.enc.Hex.parse(key);
var iv = CryptoJS.enc.Base64.parse(iv);
return CryptoJS.AES.encrypt(string, key, {
iv: iv,
mode: CryptoJS.mode.CBC
}).toString();}
function decrypt(string, key, iv){
var key = CryptoJS.enc.Hex.parse(key);
var iv = CryptoJS.enc.Base64.parse(iv);
return CryptoJS.AES.decrypt(string, key, {mode: CryptoJS.mode.CBC, iv : iv}).toString(CryptoJS.enc.Utf8);}
Looking forward for solution, Thanks.