如何将生成的QR- code存储在SD卡图像(ZXing库) [英] How to store the Generated QR-Code as an image in SDCard (ZXing library)

查看:138
本文介绍了如何将生成的QR- code存储在SD卡图像(ZXing库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我米制作基于QR code的应用程序。我必须生成一个特定的字符串的QR- code,也是我必须保存在SD卡上生成的QR- code。使用 Zxing 库是有可能。

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.

所以对于我能够生成QR- code,使用下面的code。

So for I am able to generate the QR-Code, using the following code.

请注意:我米通过意向调用QR- code扫描仪。
我米插入使用的EditText 字段,现在输入。见下文

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.

我只是想挽救这个生成QR- code在我的Andr​​oid设备的SD卡。

I just want to save this Generated QR-Code in the SD card of my android device.

问候
卡迪尔·侯赛因

Regards Qadir Hussain

推荐答案

哼!
OK,然后看到这个链接。
在这个环节斑马线库用于!
并且它简单地描述!
的http:// www.mysample code.com / 2012/09 / Android的生成,qr- code-使用-zxing.html

让我知道是不是有用?

这篇关于如何将生成的QR- code存储在SD卡图像(ZXing库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆