wll19890224 / rongpaydemo Goto Github PK
View Code? Open in Web Editor NEWpos调用demo
License: MIT License
pos调用demo
License: MIT License
Hello,
I came across your work in an sdk disk for a POS machine. Could spare a few seconds to help me?
I am trying to print while following your demo application
public void print(View view) {
String msg = getPrintFormatMsg(mEditText1.getText().toString());
try {
Intent intent = new Intent();
Bundle args = new Bundle();
args.putString("msg", msg); // 打印内容规范 请参考《全民付收银台线下插件商户销售单据打印规范》
args.putString("packageName", getPackageName()); // 应用包名
intent.putExtra("data", args);
intent.setAction(ACTION_PRINT); // 操作类型
startActivity(intent);
} catch (Exception e) {
Log.e("TAG", e.getMessage());
}
}
But I keep getting this activity not found and It does't seem to be part of the demo project source.
private static final String ACTION_PRINT = "com.rongcapital.print";
Could you guide me on how to print a simple test file and or bitmap?
PS: Already tried this
byte[] buffer = msg.getBytes();
PrintTask printTask = new PrintTask();
Printer printer = new Printer();
//Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_baseline_cloud_deposit);
printTask.setPrintBuffer(buffer);
//printTask.setPrintBitmap(bitmap);
Log.d(TAG, new String(buffer));
for (int i = 0; i < buffer.length; i++){
Log.d(TAG, new String(String.valueOf(buffer[i])));
}
printer.startPrint(printTask, new PrinterCallback() {
@Override
public void onResult(int i, PrintTask printTask) {
Log.d(TAG, "Print Result: " + i);
}
});
But doesn't seem to print anything clear on the paper. Thanks again
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.