Reputation: 113
I have managed to build the core and and I have imported the source "android" and it worked perfectly, but I want to know the result type of scan using zxing "eg: URL, TEL,ISBN...." . I need it to make some optionals Treatments in my application. How can I do it?
If it is possible to do it "eg: contact name and phone number coded with QR" how can i extract the phone number and title separately. !! I looked for many classes like ParsedResult.java and TelParsedResult.java on the package name core\com\google\zxing\client \result but i misuse and can't exploit it.
Upvotes: 2
Views: 2183
Reputation: 1400
The result that you get after scanning is a string. Parse the string and you will know the type of qrcode. Each type of QR code has a specific start, like for Location QR the result we get starts with "geo:", for URL QR the result starts with "http:" or "www.". So try parsing the result that you get after scanning the QR code.
Upvotes: -1
Reputation: 10129
The simplest way to use zxing is to use it through the intents interface, using the intents integrator. However, doing it this way means you don't have access to the Result
object, just a simple string of the contents. If you're going the hardcore route, you can import the whole zxing tree into your source (assuming you can comply with the license) and use ResultParser.parseResult(Result theResult)
.
My recommendation would be to just use the intents integrator and parse it yourself. The format is very simple, so it should be trivial to split apart with basic string functions.
Upvotes: 4