First Question is if it really releases the device camera ? As on my android device, the 'camera in use' light is still blinnking eventhough the hardware.camera.enabled is set to false and application screen is black.
Also when i enable it again through the code -
AR.hardware.camera.enabled=true;
it doesn't enable the camera ( does not show any effect on the app screen). The screen is still black. What I have observed that, after this point if I bring up any other activity (i.e. basically put my app activity in background) and then bring up my app activity again in foreground ( onresume ), the camera view is loaded correctly.
So the Second Question is, do we need to call any other function to enable the camera view again ?? How does putting the activity in background and bringing it up again (effectively calling architectView.onResume() ) help ?
A
Abhay Chaware
said
about 7 years ago
For my First Question above, Wikitude is certainly not releasing the camera ... as I can see from the logcat. So disabling wikitude camera might help from application performance standpoint, but not from device resources ( camera, battery ) standpoint .. camera will remain ON and it will continue to drain the battery. @Wikitude experts .. could you please confirm ?
Also, for the Second Question above, I tried this and it works.
Inside the javascript, --------------------------------
function cameraOff() { AR.hardware.camera.enabled=false; }
function cameraOn() { AR.hardware.camera.enabled=true; }
Inside Activity Class ---------------------------------------
But I feel this (calling onPause() and then onResume() ) is not the right way of re-loading camera view after enabling the AR.hardware.camera Again, @Wikitude experts, could you please advise ?
Regards
Abhay
A
Abhay Chaware
said
about 7 years ago
Any insights on this one, experts ? We need to make some design decisions based on this .. So this is urgent.
Thanks
Abhay
A
Andreas Schacherbauer
said
about 7 years ago
Hi Abhay, In our next minor udpate, we unify the Android Camera handling across all Android products. After that, the camera will be relesed if you disable the camera hardware in your js code. It then should not be necessary anymore to call onPause/onResume afterwards manually.
The next update will be available end of April/beginning of May. If you can't wait that long, your second solution is fine but as you already mentioned, is a workaround.
Best regards
Andreas
A
Abhay Chaware
said
about 7 years ago
Hello Andreas,
Thanks .. That is a good news .. Is this going to be update to release 5+ ? Because of device restriction/s for now atleast, we are tied to version 4.* Wikitude SDK .. if it is only update to version 5.* , would it be possible to backport on 4.* ?
regards
Abhay
A
Andreas Schacherbauer
said
about 7 years ago
Hi Abhay, It's SDK 5.x only. We don't release updates for previous SDK versions. Sorry.
Best regards
Andreas
A
Abhay Chaware
said
about 7 years ago
Oh . I understand. We kind of need this option on a device which has Android api level 15. So we can not use Wikitude 5.x. Is there 'any' way we could backport this / achieve this on to earlier version of WIkitude ( 4.0.3 ) ?
Thanks for your help Andreas.
regds
abhay
A
Andreas Schacherbauer
said
about 7 years ago
I'm afraid that if your workaround does not work on api level 15 (SDK 4.x), I can't help you. Maybe you can contact our sales team (sales@wikitude.com) to talk about a SDK 5 discount.
Abhay Chaware