Using RedLaser’s 3.X SDK getBeepResource() is never called. The application scans barcodes just fine, but I’d like an audio beep as well.
What enables the beep? I don’t see anything on the BarcodeScanActivity class.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the 3.0 RedLaser SDK, we removed the feature where the SDK plays a sound when a barcode is scanned. Instead, the BarcodeScanActivity periodically informs its concrete subclass of the barcodes it has found, via the onScanStatusUpdate method. You can read about this method in the SDK documentation.
You can use Android’s MediaPlayer object to create a media player that will play your sound file, and call MediaPlayer.start() when a new barcode has been found.
The reason we changed how this worked has a lot to do with the “wrong barcode” problem. This is where your application is looking for a specific type of barcode, but the user is holding the phone up to a different type of barcode, because they don’t know any better. With the 3.0 SDK, your application can configure the SDK to scan for all supported barcode types, and if the user tries to scan the ‘wrong’ type you can gently tell them so without leaving the scan session. You just have to evaluate the results as they come in, and not exit the session until the ‘right’ barcode type is seen.
A side effect of this solution is that the SDK doesn’t know which barcode type is the ‘right’ type and which ones are types that the application wants to be told about but won’t actually use. Therefore, having the SDK play a beep sound every time a barcode is found doesn’t make sense. The beep sound should only be played when the ‘right’ type of barcode is scanned and only the application knows what that is.