Android Question .

davidlub

Member
Licensed User
Longtime User
Hi,

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.

Hope someone can help.

Thanks

David
 
Upvote 0

davidlub

Member
Licensed User
Longtime User
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
 
Upvote 0

davidlub

Member
Licensed User
Longtime User
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:
  1. Restrict the screen orientation to portrait in the activity that takes the photograph.
  2. 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.
  3. 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.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
You can also ask the App to increase the heapsize available.. although all this does is give it more memory to fill up..
 
Upvote 0
Top