For the last days I have been trying to implement a Edittext Dialog which the user introduces an 8-bit array (1 or 0) and then the application will transform this bit array into decimal and hexadecimal value (if it is 11111111 it will be dec=255 and hex=0xFF) but I don't know hot to implement this case. If it is not possible to implement in this way, it will be also posssible to instead of a bit input, it can be a int/decimal input.
Here is the code I have implemented to show the Edittext Dialog:
else if (uuid.equals(BleDefinedUUIDs.Characteristic.PASSWORD)){
final EditText passtext = new EditText(v.getContext());
new AlertDialog.Builder(v.getContext())
.setTitle("Password Modification")
.setMessage("Please, introduce the new 8-bit password (with 1 or 0):")
.setView(passtext)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Code to obtain the the bit array/int from the edittext box
}
})
.show();
}
Does anyone know how to implement this?