content: package com.alphawallet.app.util;
  
  import android.content.Context;
  import android.graphics.Bitmap;
  import android.widget.Toast;
  
  import com.google.zxing.BarcodeFormat;
  import com.google.zxing.MultiFormatWriter;
  import com.google.zxing.common.BitMatrix;
  import com.journeyapps.barcodescanner.BarcodeEncoder;
  
  import com.alphawallet.app.R;
  
  public class QRUtils {
      public static Bitmap createQRImage(Context context, String address, int imageSize) {
          try {
              BitMatrix bitMatrix = new MultiFormatWriter().encode(
                      address,
                      BarcodeFormat.QR_CODE,
                      imageSize,
                      imageSize,
                      null);
              BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
              return barcodeEncoder.createBitmap(bitMatrix);
          } catch (Exception e) {
              Toast.makeText(context, context.getString(R.string.error_fail_generate_qr), Toast.LENGTH_SHORT)
                      .show();
          }
          return null;
      }
  }
  