I am getting the same problem on two different devices so I think it is not a system issue in the device but a problem in my app. It happens after three or four pictures and leaves the app in a strange corrupted state. I did not see anything untoward in the logs.
I have tried the suggested fix to pause for 3 seconds while "TakePicture" runs but that made no difference.
Hi Erel,
I am pretty sure now that my problem is that I am running out of memory leaving everything in a weird state.
Thanks for the response. I will try and sort it out.
David
Hi
I have resolved the problem I think, but it seems that the Camera and by extension the the CamerEx class are a bit brittle. I don't think that it is a memory leak problem as the process size was not growing much with new photographs. I doubt this is a B4A problem, perhaps generic Android. Anyway the steps I took to get a stable app that can take many photos without crashing were:
Restrict the screen orientation to portrait in the activity that takes the photograph.
Set the picture size to the smallest mode possible. This has its own problems as you cannot access the SetPcitureSize method till the camera has been fully initialised which takes a variable amount of time. I got round this with:
Msgbox("Click when camera is ready","Pause")
after the CamEX.Initialise call.
Even though I was not convinced about the memory issue I did put in explicit recycle and garbage collect calls. These did not slow the app down significantly.