如何从.net Windows应用程序中的条形码扫描器读取数据?
有人可以给出要遵循的步骤顺序吗?我是新手.
Windows Phone 7是否有良好的BarCode扫描功能或库?
我假设图书馆将扫描手机拍摄的图像,并返回图像的条形码(如果有).
此外,是否有一个很好的入门扫描条形码并在应用程序中使用它们(如何映射到供应商,产品等),适用于WP7或.NET?
我正在开发一个应用程序,用于barcode在扫描后获取项目的产品信息barcode.
我不希望用户ZXing barcode单独安装应用程序,因此我将ZXing代码嵌入到我的项目中.所以我能够获得barcode ID number.
我想要得到的产品信息像名称,生产厂家,价格等使用使用条形码编号谷歌搜索API购物.
这是我用过的代码
public class JSONExampleActivity extends Activity {
TextView httpStuff;
DefaultHttpClient client;
JSONObject json;
final static String URL = "https://www.googleapis.com/shopping/search";
String upc = "/v1/public/products?country=US&q=691464717759&restrictBy=gtin=691464717759";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
httpStuff = (TextView) findViewById(R.id.tvHttp);
client = new DefaultHttpClient();
new Read().execute("items");
}
public JSONObject products(String upc) throws ClientProtocolException, IOException, …Run Code Online (Sandbox Code Playgroud) 在我的项目中,我必须通过蓝牙使用条形码扫描仪Symbol CS3070读取条形码.即; 我必须通过蓝牙建立Android设备和条形码扫描仪之间的连接.任何人都可以告诉我如何从条形码阅读器读取值以及如何设置通信?我已经阅读了蓝牙开发者指南,我不想在蓝牙键盘仿真(HID)模式下使用条形码阅读器(我的一些文本视图可以用软键盘和条形码阅读器填充,我无法控制焦点)
我会用这样的线程与读者沟通
private class BarcodeReaderThread extends Thread {
private final BluetoothServerSocket mmServerSocket;
public BarcodeReaderThread(UUID UUID_BLUETOOTH) {
// Use a temporary object that is later assigned to mmServerSocket,
// because mmServerSocket is final
BluetoothServerSocket tmp = null;
try {
// MY_UUID is the app's UUID string, also used by the client code
tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord("BarcodeScannerForSGST", UUID_BLUETOOTH);
/*
* The UUID is also included in the SDP entry and will be the basis for the connection
* agreement …Run Code Online (Sandbox Code Playgroud) 我必须使用自定义字段生成代码:idof field+nameof field+valuesof field.
我可以在QRcode内编码多长时间的数据?我需要知道我可以插入多少个字段\值.
我应该使用XML还是JSON还是CSV?什么是最通用和最有效的?
我编写了一个程序,从usb第二个键盘(实际上是条形码扫描仪)获取输入.问题是如果另一个窗口处于活动状态,则在那里输入数据而不是在我的程序中.有人可以就我做错了什么给我建议吗?
#include <stdio.h>
#include <string.h>
int main(int argc, char * argv[]){
FILE * fp_in;
char * data;
fp_in = fopen("/dev/input/by-id/usb-04d9_1400-event-kbd","r");
if(fp_in == NULL){
fprintf(stderr,"Failed to open input by id\n");
}
fp_in = fopen("/dev/input/by-path/pci-0000:00:1d.1-usb-0:2:1.0-event-kbd","r");
if(fp_in == NULL){
fprintf(stderr,"Failed to open input by path\n");
return 1;
}
while(1){
fscanf(fp_in,data,"%s");
fprintf(stderr,"%s",data);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
谢谢
如何在Linux下编写一个附加到输入设备的程序,在这种情况下是一个条形码扫描器,这样输入就不会转到具有键盘焦点的程序?
我正在开发一个项目,我们需要使用Zebra打印机来处理条形码标签.我们正在使用C#,我们在打印方面做得很好,将原始ZPL字符串发送到打印机(使用winspool.drv).
但是,我们还需要从打印机读取,并没有运气.
我们需要从打印机获取状态,这是ZPL命令"~HS"的输出,因此我们可以判断内存中有多少标签等待打印.winspool.drv中的EnumJobs()只在Windows假脱机上有作业,一旦它们被发送到打印机,它们就会从该列表中消失.但这并不意味着标签已被打印,因为打印机有一个剥离传感器,一次只打印一个标签,我们显然对将批量标签发送到打印机感兴趣.
我尝试了类似的东西(使用winspool.drv调用):
OpenPrinter(szPrinterName, out hPrinter, IntPtr.Zero);
WritePrinter(hPrinter, pBytes, dwCount, out dwWritten); // send the string "~HS"
ReadPrinter(hPrinter, data, buff, out pcRead);
Run Code Online (Sandbox Code Playgroud)
但我在ReadPrinter调用中什么也得不到.我甚至不知道这是否是正确的方法.
之前有人解决了这个问题吗?
谢谢.
我已经下载了适用于Android的Zxing条码扫描器代码,但我在源代码中找不到com.google.zxing包.我认为该项目缺少库或JAR文件.任何人都可以帮我找到那个包吗?
这些是未解决的导入:
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.google.zxing.ResultMetadataType;
import com.google.zxing.ResultPoint;
Run Code Online (Sandbox Code Playgroud) 使用zxing生成Qr代码的代码是---
它需要字符串数据,imageview这很好用
private void generateQRCode_general(String data, ImageView img)throws WriterException {
com.google.zxing.Writer writer = new QRCodeWriter();
String finaldata = Uri.encode(data, "utf-8");
BitMatrix bm = writer.encode(finaldata, BarcodeFormat.QR_CODE,150, 150);
Bitmap ImageBitmap = Bitmap.createBitmap(150, 150,Config.ARGB_8888);
for (int i = 0; i < 150; i++) {//width
for (int j = 0; j < 150; j++) {//height
ImageBitmap.setPixel(i, j, bm.get(i, j) ? Color.BLACK: Color.WHITE);
}
}
if (ImageBitmap != null) {
qrcode.setImageBitmap(ImageBitmap);
} else {
Toast.makeText(getApplicationContext(), getResources().getString(R.string.userInputError),
Toast.LENGTH_SHORT).show();
}
}
Run Code Online (Sandbox Code Playgroud)
现在我的问题是,如何bar code使用相同的库.我看到一些相关的文件, …