Update and Release resources

Forums:

Good Day! 

I have tried to use this library for my interests, but during the testing, I faced one problem. 

When I am openning the camera in another application, the smarphone says "Camera Error". I think that I should release camera resources when the application is paused or destroyed. How I can realize this issue ? 

And after resuming application, how Do I can update AR objects ?

I tried 

mBeyondarFragment.startRenderingAR();

and

mBeyondarFragment.stopRenderingAR();

mBeyondarFragment.getCameraView().releaseCamera();

Can you help me?

Best wishes, Anvar

Beyondar's picture

I will check the issue about the camera (https://github.com/BeyondAR/beyondar/issues/30).

About updting the geoObjects, it is not very clear what you mean... if you want to access the GeoObject and change it, just do it in the instance that you send to the world, or search for it using the fragment like this:

beyondarFragment.getWorld().getBeyondarObjectList

Try it and tell me if this is wat you need. THanks for the info!!

anvar1101's picture

Good day.

According the camera resource, I call releaseCamera in CameraView when onPause () is executed and configureCamera during onResume() is called. 

Beyondar's picture

It is not very clear what you mean. According to https://github.com/BeyondAR/beyondar/blob/master/android/BeyondAR_Framework/src/com/beyondar/android/fragment/BeyondarFragment.java the camera is not release on pause, only the preview is stopped. Shall it be released as well?

anvar1101's picture

mBeyondarFragment.stopRenderingAR();
				mBeyondarFragment.getCameraView().releaseCamera();

//This is called in onResume method of my activity
Beyondar's picture

I've updated the camera source in this branch: https://github.com/BeyondAR/beyondar/tree/33_rotate_camera_2.1

Can you check if this fixes your issues?? 

Thanks!

anvar1101's picture

Hi! 

Yes, I have used new revision of library. It works fine! 

Thanks!

Beyondar's picture

Thanks you for reporting!! I will create a new version this weekend :)