I need to create a QRcode from a string that I have randomly generated. I have looked into using zxing for doing this but I'm unsure if its the best way for creating the QRcode. The code below is the work I've done so far. All it does is when I press the button, it displays the random string in a TextView. Just wondering is there a simple way of doing this? Thanks.
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
textView.setText(getRandomString(12));
}
});
}
private static String getRandomString(int i ){
final String chars = "abcdefghijklmonpqrstuvwxyz0123456789";
StringBuilder results = new StringBuilder();
while (i > 0) {
Random rand = new Random();
results.append(chars.charAt(rand.nextInt(chars.length())));
i--;
}
return results.toString();
}