Android Question How to preserve FocusMode of a camera?

MirajsX

New Member
Licensed User
I've created a TimeElapse widget which runs an activity in regular time intervals and this activity then takes a picture. A problem occured - with each call, the activity initialize the camera again and the default settings are set (focus, etc..) and the setting I created is lost.

I need for the camera setting to remain the same for all pictures taken. Currently, I set the FocusMode = "CONTINUOUS_PICTURE" in the activity setting (which uses CamEx2). After focusing on a particular item, I set the FocusMode = "OFF". If the activity remains open, everything works fine, the focus doesn't change, the pictures are made with the same setting. If I close the activity, the camera initialize itself into its default setting when it's open again. How can I save the pre-set camera parameters and use the same focus parameters during the next time the activity is run by the widget?

One solution (even though it's not the right solution) would be not to close the activity, the widget would only activate the activity in a given time interval. A problem occurs when another activity uses the camera.

Is it possible to save the camera setting parameters in any way and re-use the same setting?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top