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.
Controlling Scanner Indicator LED Bar Programmatically |
2 Replies
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());
}
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?