To generate qrcode using android with save as image class
in your activity
generateCode(YOUR VALUE HERE);
First parameter is Boolean that do you want to share or not ? ture for save with share. Second parameter is input value. Type (String) Thirtd paramter is output. Type (Bitmap)
saveAndShare(false, inputStr, output);
private void saveAndShare(final boolean shouldShare, String name, Bitmap bitmap) {
if(shouldShare) {
AppUtils.showToast(mContext, getString(R.string.preparing));
} else {
AppUtils.showToast(mContext, getString(R.string.saving));
}
SaveImage saveImage = new SaveImage(name, bitmap);
saveImage.setSaveListener(new SaveImage.SaveListener() {
@Override
public void onSaved(String savedTo) {
if (shouldShare) {
AppUtils.share(mActivity, savedTo);
} else {
AppUtils.showToast(mContext, getString(R.string.saved_to) +"'"+ Constants.SAVE_TO +"' "+getString(R.string.directory_in));
}
}
});
saveImage.execute();
}