Enterprise Browser 1.5 Camera API

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

Abhineet Agarwal
Dear Tony,I have attached the

Dear Tony,

I have attached the sample Camera API page for your reference.

  1. EB_Camera_API.html
  2. ebapi-modules.js - This is used internally by EB_Camera_API.html page.

Copy both the above file to EnterpriseBrowser installed location in the device and set the StartPage tag value of Config.xml as mentioned below.

     <General>

        <Name value="Menu"/>

        <StartPage value="file://%INSTALLDIR%/EB_Camera_API.html" name="Menu"/>

      </General>

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.

  1. Press Enumerate Camera button.
  2. Select Camera type from the drop down menu which will populate possible camera objects(present in the device) after step 1 is performed.
  3. Press Take Picture button to take the picture after performing step 2.
  4. Press choose Picture button to replicate the captured image to the html page after performing step 3.

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

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Tony Ruddock
AbhineetMany thanks for the

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

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Tony,This is looking

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

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Tony Ruddock
AbhineetI have managed to get

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

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Tony Ruddock
So, I'm getting a bit further

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

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Tony,This looks to me as

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

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Tony Ruddock
AbhineetUsing your revised

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

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Tony,Thanks for the

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

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Herbert De Jong
Hello Tony,the correct way to

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.

  1. 1) TC70  partno of the device
  2. 2) OSbuild  in use ( see about Phone /  BuildNumber  
  3. 3) The code snippet you are using and where the saving of a photo is failing.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Tony Ruddock
Thanks Herbert.

Thanks Herbert.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments