Android Question CamEx2 - continuously take photos while saving battery

Star-Dust

Expert
Licensed User
Longtime User
I developed an app that automatically takes a photo every 5 minutes. To do this I have to keep the device always alive and never let it go in the background.
This leads to high battery consumption.
I tried with Receivers to wake the device every 5 minutes, keeping the App in the foreground but with poor results. Every time it goes into the background everything stops.
I tried to have the shot taken by a service that I always kept alive with the "Draw on App" method but if it doesn't have an activity and a panel to connect to, CamEX2 can't take photos.

I wonder if it is possible to reduce consumption on the mini by taking a photo every 5 minutes.
 
Last edited:

Pearl

New Member
Camera without activity by @JordiCP
I wonder if this version of chathead code was shared as i see final updated version is for crawling spiders
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
5 minutes is an interval too short for StartServiceAt.

You will need to have a foreground service that starts an activity every 5 minutes. Then open the camera, take a picture, close the camera and close the activity.
Thanks Erel. It is a very particular request that was made to me, and in fact 5 minutes is very little.

I seem to have understood that I keep a business open only to keep service at the forefront. At the moment of the photo I open a second activity which turns on the camera, takes the photo and closes again.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…