For scientific measurements, I would like to access the camera frames from a service. The idea is to analyze the images coming from the camera in real-time under some condit
You can send the preview to a SurfaceTexture instead (setPreviewTexture()). This won't disappear when the app is paused. Requires API 11+.
You can see various applications of this technique in Grafika, which is generally doing video or GLES manipulation rather than stills, but the idea is similar.