Controlling Scanner Indicator LED Bar Programmatically

I'm programming an app for the MC92N0 handheld, and I have a business requirement to use the indicator bar to alert the user that something has happened on the server that needs attention.  A red flashing light would indicate an urgent issue.  An amber light would be a warning, etc.  Is this possible? 

 

From what I've found so far, those lights are used for charging status and scanner status (not scanning, successful decode).

 

I'm currently using the Xamarin component, but I could possibly create a new binding if it's something that's in an excluded namespace.

Anonymous (not verified)
You can use the standard

You can use the standard Android notification APIs.  Take a look here. 

android - How to have LED Light Notification? - Stack Overflow

I tried this code, and it does work,  but as mentioned in the post,  it will only light up the LEDs if the screen is off.

private void testNotification() {

  Notification.Builder builder = new Notification.Builder(this);

  builder.setSmallIcon(R.mipmap.ic_launcher)

  .setPriority(Notification.PRIORITY_HIGH)

  .setOngoing(true);

  builder.setLights(0xff00ff00, 300, 100);

  NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

  manager.notify(1, builder.build());

}

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Chase Carlile
Thank you.  I'll play around

Thank you.  I'll play around with that then. I'm assuming the scanner's beeping noise would also be controlled through the Android api?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
You can add a sound to your

You can add a sound to your notification. If you add one line as I have done below,  it will play the default notification sound.  If you want that sound to be the scanner beep,  you can go into settings/sound and set the default notification sound to "Decode".

private void testNotification() {

  Notification.Builder builder = new Notification.Builder(this);

  builder.setSmallIcon(R.mipmap.ic_launcher)

  .setPriority(Notification.PRIORITY_MAX)

  .setSound(Settings.System.DEFAULT_NOTIFICATION_URI)

  .setOngoing(true);

  builder.setLights(0xff00ff00, 300, 100);

  NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

  manager.notify(1, builder.build());

}

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments