I am working on a camera implementation similar to what Snapchat offers. I have created a subclass of SimpleCameraHost to customize the directories and file paths and to handle saveImage(I am cropping the image into a square before I save it to disk). I have also subclassed CameraFragment as you(Mark) have in the demo.
I need to take three pictures(Take pic...user okays it...Move onto second pic..repeat...) before I continue with the flow of the app. I am using the single shot mode. In the Oncreate() of the DemoFragment
SimpleCameraHost.Builder builder =
new SimpleCameraHost.Builder(new MyCameraHost(getActivity(), useFFC));
setHost(builder.useSingleShotMode(true).build());
Question : I need to know how to prevent the cameraview from restarting the camera every time I pause the app while I'm on the 'okay the pic page' and resume.Also if I leave the app idle on this page for a while, it seems to freeze and my camera cannot be started again(from any camera app including the default...I have to restart the device). I reckon this happens because I have not released the camera. Could you please direct me as to how I should handle pausing and resuming the app.
In the demo app, if I switch to single-shot mode, take a landscape picture using the rear-facing camera, press HOME from the photo-preview screen, return to the app from the recent-tasks list, and press BACK, everything behaves fine, at least on the Nexus 4 that I just tried it on.
Hence, I would suggest that you compare your app to the demo app and see where things differ that might cause this behavior.
If you feel that there is a bug in the library, feel free to file an issue, but you would need to give me a complete set of materials to be able to reproduce the problem. That would include details of the device (e.g.,
Build.PRODUCT
), the code to reproduce it (if it is not one of the demo apps), and the steps I should manually follow to reproduce it.Once again, I cannot reproduce this behavior. Immediately following the steps that I outlined above, I took another picture in single-shot mode, and left the app on the photo-preview screen while I composed the first part of this answer. I just pressed BACK, and everything is normal. So, again:
Compare your app to the demo app, to see if you can determine what you may be doing that might cause this effect
File an issue if you think that it is a bug in the library, but only do so if you can give me steps to reproduce the bug