Start a new topic - does it actually release the camera - does it actually release the camera

From this reference,

camera can be disabled by using,;


and it works great. Shows black background. 

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 is set to false and application screen is black. 

Also when i enable it again through the code -;


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 ?





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()

function cameraOn()

Inside Activity Class

private void turnOffCamera() {
private void turnOnCamera() {
try {
}catch (Exception re){}


But I feel this (calling onPause() and then onResume() ) is not the right way of re-loading camera view after enabling the Again, @Wikitude experts, could you please advise ?





Any insights on this one, experts ? We need to make some design decisions based on this .. So this is urgent.



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


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.* ?



Hi Abhay,
It's SDK 5.x only. We don't release updates for previous SDK versions. Sorry. 

Best regards


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.



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 ( to talk about a SDK 5 discount.

Best regards

Login or Signup to post a comment