Is there anyway of converting value of string to long in Java?
Apparently, String.format("%040x", new BigInteger(1, message.getBytes(message)));
only changes the format of it instead of the value. I need to change the value as I will be using the converted variable for encryption (PRINCE) process which will be processed in long (hexadecimal) format.
public void onClick(View v, String args)
{
String phoneNo = txtPhoneNo.getText().toString();
String message = txtMessage.getText().toString();
if (phoneNo.length()>0 && message.length()>0){
//prince pri = new prince();
//message = toLong();
String.format("%040x", new BigInteger(1, message.getBytes(message)));
prince.Encrypt (message, k0, kop, k1, t);
sendSMS(phoneNo, message); }
else
Toast.makeText(getBaseContext(),
"Please enter both phone number and message.",
Toast.LENGTH_SHORT).show();
}