Android: AsyncTask how to use wait/notify

Is it possible to call wait & notify inside an AsyncTask? So far, I tried to use them but all it does to block the AsyncTask forever. How can I overcome this? My usage is: I have a camera frame generated, and I want to send it to server continously however, I want to make something better than

while( true){
 if (frameAvaialble){

Which drains useless CPU power.


You can try ConditionVariable,

private ConditionVariable mCondition = new ConditionVariable(false);

while( true ){

//other code
frameAvaialble = true;;

Need Your Help

Can I use recursion to handle GPIO?

c embedded stm32 gpio

I'm newbie using STM32f100RB which is based on ARM Cortex M3.I was trying to use recursion to handle GPIO input, but it didn't work.Can anyone tell me why?

Static sub-fields in mongoid model

ruby-on-rails mongoid

I was reading this tutorial on Angular.js, which I am trying to implement on Ruby on Rails with Mongoid, for educational purposes.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.