i am trying to read all information hidden in a bar code , i have implemented the zxing lib in android app , but it is giving me code_128 and all unclear details , i want the exact details , for example if i am scanning a bar code of a book it should give me details of the name of the book and all ..please help where i am going wrong . Is the zxing the right library , i want to develop this app where on scanning all details of the book got displayed.
Below is the code that i am using to read the details
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
//retrieve scan result
IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanningResult != null) {
String scanContent = scanningResult.getContents();
scanningResult.toString();
String scanFormat = scanningResult.getFormatName();
formatTxt.setText("FORMAT: " + scanningResult.toString());
contentTxt.setText("CONTENT: " + scanContent);
//we have a result
}else{
Toast toast = Toast.makeText(getApplicationContext(),
"No scan data received!", Toast.LENGTH_SHORT);
toast.show();
}
}
答案 0 :(得分:2)
https://en.wikipedia.org/wiki/Code_128
https://en.wikipedia.org/wiki/International_Standard_Book_Number
Barcode is actually a very small String with a special look as strips. I am not sure what/which barcode you are scanning on the book. I will use ISBN as an example, ISBN is a 13 digit code, e.g. 978-3-16-148410-0
, you can get no information simply by looking at this.
An ISBN is assigned to each edition and variation (except reprintings) of a book. For example, an e-book, a paperback and a hardcover edition of the same book would each have a different ISBN.
However, they are actually unique. Only if you have a library to map the code to the corresponding book, you can get the information you need.
I.e. Without a library, the code gives almost no information.