I try to reverse my binary string.Any solution?
private OnClickListener btnConvListener = new OnClickListener() {
public void onClick(View v) {
try{
String ag=edittext1.getText().toString();
HexToBinary(ag);
} catch (Exception e) {
Toast.makeText(getBaseContext(), "Not insert data!",Toast.LENGTH_SHORT).show();
}
}
};
void HexToBinary(String Hex) {
int i = Integer.parseInt(Hex, 16);
String Bin = Integer.toBinaryString(i);//Converts int to binary
text1.setText(Bin);
//Bit reversal method....
int reversedNum = Integer.reverse(i);
text2.setText(reversedNum);
}
This function converts string Hex to string Binary...but i want an extra output to opposite LSB->MSB... I test it but i have not output....i have exception from try/catch...error not input data...why? Shows only the original binary...not the reverse...