I m making an app based on QR code. I have to Generate a QR-Code of a specific String and also I have to save the generated QR-Code in SD card. is it possible using the Zxing
Library.
So for I am able to generate the QR-Code, using the following code.
Note:I m calling the QR-Code Scanner via Intent.
I m inserting the input using an EditText
Field right now. see code below
public class MainActivity extends Activity {
EditText edQR_Field;
Button btnGenerate_QR_Code;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnGenerate_QR_Code = (Button) findViewById(R.id.button1);
edQR_Field = (EditText) findViewById(R.id.editText1);
btnGenerate_QR_Code.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String input = edQR_Field.getText().toString();
Intent intent = new Intent(
"com.google.zxing.client.android.ENCODE");
intent.putExtra("ENCODE_TYPE", "TEXT_TYPE");
intent.putExtra("ENCODE_DATA", input);
intent.putExtra("ENCODE_FORMAT", "QR_CODE");
intent.putExtra("ENCODE_SHOW_CONTENTS", false);
startActivityForResult(intent, 0);
Toast.makeText(MainActivity.this, input, Toast.LENGTH_SHORT)
.show();
}
});
}
}
and I m getting this.
Question
I just want to save this Generated QR-Code in the SD card of my android device.
Regards
Qadir Hussain
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…