I think this is a good decision to keep the applications "responsive".
This way you could show a progress bar or something similar right
after the call to the takePicture() method.

> I could not find any
> documentation about a Listener for completion of snapshot-taking, so
> to fix things I now had to add my own semaphores and a while-sleep to
> make sure my snapshot is taken and processed before I reuse the bitmap
> in which I store the onPictureTaken() data.

Why don't you send a message to a Handler (http://code.google.com/
android/reference/android/os/Handler.html) when your processing in the
onPictureTaken() is finished? When you receive that message you could
remove the progress bar and your picture would be ready to use.

Cheers,

Jose Luis.

On 29 oct, 14:22, blindfold <[EMAIL PROTECTED]> wrote:
> After getting unexpected results from takePicture() and subsequent
> image processing, I discovered that takePicture() is asynchronous.
> Although the documentation indeed states that takePicture() (just?)
> registers a callback,
>
> http://code.google.com/android/reference/android/hardware/Camera.html
>
> thereby suggestive of some other method to take the actual snapshot
> (but such a method does not exist), takePicture() also doubles as a
> trigger to actually take the snapshot, *but* asynchronously with the
> code in which takePicture() is called. To me this seems highly
> confusing at best, if not plain ugly. I could not find any
> documentation about a Listener for completion of snapshot-taking, so
> to fix things I now had to add my own semaphores and a while-sleep to
> make sure my snapshot is taken and processed before I reuse the bitmap
> in which I store the onPictureTaken() data.
>
> Regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to