2

I'm using C#.net Xamarin in Visual Studio 2015 to create a series of layouts and activities for a Zebra MC92N0 mobile computer running Android KitKat. Everything works fine so far, using DataWedge to acquire the scan data.

The scanner is being used in a warehouse environment to do a physical inventory. Scenario: When a user scans a bin location, then proceeds to scan the items in the bin, the user needs to be alerted when/if an item is in the bin that shouldn't be located there. Displaying an error on the screen is no problem, but the users are typically not looking at their screen while they're scanning a handful of items so I need an audible alert to sound off.

Anyone have any experience with these devices and producing the beeps?

Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
crosstec
  • 302
  • 3
  • 9
  • 1
    Possible duplicate of [How to play an android notification sound](http://stackoverflow.com/questions/4441334/how-to-play-an-android-notification-sound) – jgoldberger - MSFT Jan 06 '17 at 20:50

2 Answers2

2

I found a solution that worked for me:

ToneGenerator generator = new ToneGenerator(Android.Media.Stream.Alarm, 100);
generator.StartTone(Tone.CdmaAlertCallGuard);
SystemClock.Sleep(1000);
generator.Release();

Worked like a charm. You can change the alerts by changing the enum value for Tone in the second line and the volume by setting the 2nd parameter when creating the ToneGenerator object.

crosstec
  • 302
  • 3
  • 9
0

in order to make the scanner beep and not the Android; the XML would be:

"<inArgs><scannerID>" + scannerID + "</scannerID><cmdArgs><arg-int>" + RMD_ATTR_VALUE_ACTION_HIGH_HIGH_LOW_LOW_BEEP + "</arg-int></cmdArgs></inArgs>"

where constant RMD_ATTR_VALUE_ACTION_HIGH_HIGH_LOW_LOW_BEEP is equal to 26; overall 27 different beep patterns are being supported.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216