本文整理汇总了Java中com.zxing.encoding.EncodingHandler类的典型用法代码示例。如果您正苦于以下问题:Java EncodingHandler类的具体用法?Java EncodingHandler怎么用?Java EncodingHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EncodingHandler类属于com.zxing.encoding包,在下文中一共展示了EncodingHandler类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setQRCode
import com.zxing.encoding.EncodingHandler; //导入依赖的package包/类
/**显示二维码
*/
protected void setQRCode() {
runThread(TAG + "setQRCode", new Runnable() {
@Override
public void run() {
try {
qRCodeBitmap = EncodingHandler.createQRCode(Constant.APP_DOWNLOAD_WEBSITE
, (int) (2 * getResources().getDimension(R.dimen.qrcode_size)));
} catch (WriterException e) {
e.printStackTrace();
Log.e(TAG, "initData try {Bitmap qrcode = EncodingHandler.createQRCode(contactJson, ivContactQRCodeCode.getWidth());" +
" >> } catch (WriterException e) {" + e.getMessage());
}
runUiThread(new Runnable() {
@Override
public void run() {
ivAboutQRCode.setImageBitmap(qRCodeBitmap);
}
});
}
});
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:AboutActivity.java
示例2: setQRCode
import com.zxing.encoding.EncodingHandler; //导入依赖的package包/类
protected void setQRCode(User user) {
// if (user == null) {
// Log.e(TAG, "setQRCode user == null" +
// " || StringUtil.isNotEmpty(user.getPhone(), true) == false >> return;");
// return;
// }
try {
//不能暴露用户隐私
qRCodeBitmap = EncodingHandler.createQRCode(HttpRequest.URL_GET
+ JSON.toJSONString(new JSONRequest(new apijson.demo.server.model.User(userId)))
, (int) (2 * getResources().getDimension(R.dimen.qrcode_size)));
} catch (WriterException e) {
e.printStackTrace();
Log.e(TAG, "initData try {Bitmap qrcode = EncodingHandler.createQRCode(contactJson, ivQRCodeCode.getWidth());" +
" >> } catch (WriterException e) {" + e.getMessage());
}
runUiThread(new Runnable() {
@Override
public void run() {
ivQRCodeProgress.setVisibility(View.GONE);
ivQRCodeCode.setImageBitmap(qRCodeBitmap);
}
});
}
开发者ID:TommyLemon,项目名称:APIJSON,代码行数:27,代码来源:QRCodeActivity.java
示例3: setQRCode
import com.zxing.encoding.EncodingHandler; //导入依赖的package包/类
/**显示二维码
*/
protected void setQRCode() {
runThread(TAG + "setQRCode", new Runnable() {
@Override
public void run() {
try {
qRCodeBitmap = EncodingHandler.createQRCode(Constant.APP_DOWNLOAD_WEBSITE
, (int) (2 * getResources().getDimension(R.dimen.qrcode_size)));
} catch (WriterException e) {
e.printStackTrace();
Log.e(TAG, "initData try {Bitmap qrcode = EncodingHandler.createQRCode(contactJson, ivContactQRCodeCode.getWidth());" +
" >> } catch (WriterException e) {" + e.getMessage());
}
runUiThread(new Runnable() {
@Override
public void run() {
ivAboutQRCode.setImageBitmap(qRCodeBitmap);
}
});
}
});
}
开发者ID:TommyLemon,项目名称:Android-ZBLibrary,代码行数:27,代码来源:AboutActivity.java
示例4: setQRCode
import com.zxing.encoding.EncodingHandler; //导入依赖的package包/类
/**显示二维码
*/
protected void setQRCode() {
// runThread(TAG + "setQRCode", new Runnable() {
//
// @Override
// public void run() {
//
// try {
// qRCodeBitmap = EncodingHandler.createQRCode(Constant.APP_DOWNLOAD_WEBSITE
// , (int) (2 * getResources().getDimension(R.dimen.qrcode_size)));
// } catch (WriterException e) {
// e.printStackTrace();
// Log.e(TAG, "initData try {Bitmap qrcode = EncodingHandler.createQRCode(contactJson, ivContactQRCodeCode.getWidth());" +
// " >> } catch (WriterException e) {" + e.getMessage());
// }
//
// runUiThread(new Runnable() {
// @Override
// public void run() {
// ivAboutQRCode.setImageBitmap(qRCodeBitmap);
// }
// });
// }
// });
//使用RxJava <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Observable.create(new ObservableOnSubscribe<Bitmap>() {
@Override
public void subscribe(ObservableEmitter<Bitmap> oe) throws Exception {
Log.d(TAG, "setQRCode Observable.create.subscribe >> currentThread = " + Thread.currentThread().getName());
try {
qRCodeBitmap = EncodingHandler.createQRCode(Constant.APP_DOWNLOAD_WEBSITE
, (int) (2 * getResources().getDimension(R.dimen.qrcode_size)));
} catch (WriterException e) {
e.printStackTrace();
Log.e(TAG, "initData try {Bitmap qrcode = EncodingHandler.createQRCode(contactJson, ivContactQRCodeCode.getWidth());" +
" >> } catch (WriterException e) {" + e.getMessage());
}
oe.onComplete();
}
}).observeOn(AndroidSchedulers.mainThread()).doOnComplete(new Action() {
@Override
public void run() throws Exception {
Log.d(TAG, "setQRCode Observable.doOnCompleted qRCodeBitmap " + (qRCodeBitmap == null ? "=" : "!=") + " null"
+ ">> currentThread = " + Thread.currentThread().getName());
ivAboutQRCode.setImageBitmap(qRCodeBitmap);
}
}).subscribeOn(Schedulers.io()).subscribe();
//使用RxJava >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
}
开发者ID:TommyLemon,项目名称:APIJSON-Android-RxJava,代码行数:57,代码来源:AboutActivity.java
注:本文中的com.zxing.encoding.EncodingHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论