I am currently developing an Android app using Kotlin which will be running on Zebra MC2700 devices. As part of the functionality of the app, I have implemented a feature where the camera opens to capture images.
However, I would like to make use of the 'enter' hardware button on the device to trigger the camera capture when the camera app is open. I would like to seek the guidance of the community on how I can achieve this functionality.
Could anyone please provide me with the necessary technical information or documentation that I would require to integrate this functionality into my app?
Thank you very much in advance
3 Replies
Hi,
You can use our KeyMapping feature the remap the enter key to launch the camera app via an intent: https://techdocs.zebra.com/mx/keymappingmgr/
Alternatively you could implement a KeyListener in your application to listen for the enter key, and then trigger the camera app yourself, which may give a bit more control.
Thanks,
James
Hi James,
First of all, thank you for your quick response. Basically when the user presses the enter key, the below code is called:
At this point the camera is already open. What I would like to achieve is to implement a KeyListener to trigger the button of the camera app which takes a picture (kindly see the image below). Is this possible ?
Thank you in advance,
Chris
Hi Chris,
Apologies, I misread your initial question - thanks for the explanation.
There is no way to trigger the camera capture programmatically w/ the default camera app, as far as I'm aware. There may be some 3rd party apps that include an API for triggering camera capture via, for example, an intent, which could then be mapped to the enter key but I don't have any specific recommendations.
Thanks,
James