As part of a web application we're writing I need to access the native camera on our TC70s.
I can see two APIs it's possible to use for this purpose:
- The old "imager" API
- The newer "camera" API
I've tried the "imager" API and it doesn't appear to fire up the native camera application,so I am not able to zoom.
I have also tried using the "camera" API. but no matter what I do, the camera won't show up to allow me to take a picture.
Does anyone have a working code example using the "camera" API?
Many thanks
Dear Tony,
I have attached the sample Camera API page for your reference.
Copy both the above file to EnterpriseBrowser installed location in the device and set the StartPage tag value of Config.xml as mentioned below.
After performing the above steps, relaunch the EnterpriseBrowser application. The sample Camera page will be opened which will allow to take the picture using device camera.
After page is open, one can check by performing the below steps in order.
Please note:
- EnterpirseBrowser installed location in the device will be <sd_card_storage_location>/Android/data/com.symbol.enterprisebrowser.
- Config.xml is also present under EnterpirseBrowser installed location.
- The sample Camera API is developed using EB Camera API. The online document for EB Camera API is available here.
Thanks & Regards,
Abhineet Agarwal
Enterprise Browser Software Lead
Points: 1
You voted ‘up’
Abhineet
Many thanks for the reply and for your example code.
Using the code you've supplied I still cannot get the camera functionality to work. All the other functions work just fine, but when I click "Take Picture" nothing happens.
Is there something on the TC70 that needs to allow Enterprise Browser acces to the camera? I have checked the permissions for Enterprise Browser and it would seem it has access to "take pictures and videos".
On further investigation, the camera object here enumData[selectedIndexPosition] and when I call EB.Camera is empty (it returns {}) - is this correct. I would have expected an object containing attributes for the selected (front/back) camera.
Thanks
Tony
Points: 0
You voted ‘up’
Dear Tony,
This is looking strange to me. I am getting the object having camera type back and front. I am able to take the picture after selecting the Camera type.
Have you ensured to copy the ebapi-modules.js to the location where EB_Camera_API.html file was placed?
Please also provide me the device detailed information as mentioned below?
- Which OS is installed?
- Which BSP is installed?
- From where the BSP was downloaded and installed?
Thanks & Regards,
Abhineet Agarwal
Enterprise Browser Software Lead
Points: 0
You voted ‘up’
Abhineet
I have managed to get a bit further - after deleting some functions in my code that used the old "imager" functionality the camera now works, but intermittently.
I'll do some further investigation and see whether I can get it to work consistently.
The OS is Android Lollipop (5.1.1). I don't know what a BSP is.
Thanks for your help.
Tony
Points: 0
You voted ‘up’
So, I'm getting a bit further, I can get the camera working pretty much most of the time (although it's not 100% of the time).
When I take a picture it is not saved - instead I get the following error "java.lang.Boolean cannot be cast to java.lang.String"
This happens regardless of how the image is saved (ToDeviceGallery or not).
Tony
Points: 0
You voted ‘up’
Dear Tony,
This looks to me as an issue. Please raise the support ticket. Our team will assist on the same.
Meanwhile, please try with the modified EB_Camera_API.html which I am attaching with this response.
The modified html file will display the image on the html page after capturing the page.
Ensure to place the ebapi-modules.js file in the same location where this html is placed.
Thanks & Regards,
Abhineet Agarwal
Enterprise Browser Software Lead
Points: 1
You voted ‘up’
Abhineet
Using your revised code I've now got the photo I've taken to display on the screen, so thanks for that.
As for raising a support ticket, how do I go about doing that?
Tony
Points: 0
You voted ‘up’
Dear Tony,
Thanks for the confirmation that the EB Camera API works with the provided HTML page.
For the other issue, please raise the support ticket at Zendesk.
Our support team will investigate the same...
Thanks & Regards,
Abhineet Agarwal
Enterprise Browser Software Lead
Points: 0
You voted ‘up’
Hello Tony,
the correct way to raise an issue with support is following:
You can call us or use the form.
see here:
https://www.zebra.com/us/en/about-zebra/contact-zebra/contact-tech-support.html
choose Mobile Computers, Scanners, WLAN and RFID Tech Support
http://online.zebra.com/contact-enu
once a case no is assigned we need the following details.
Points: 1
You voted ‘up’
Thanks Herbert.
Points: 0
You voted ‘up’