Thanks for the reply. I do agree that my code needs some re-organization.
This happens to be my first app.

I found out the root cause of the problem.

The message from the bluetooth device is broken on several occasions. I get
3 digit numbers from the device. The handler seems to read only 2 digits on
certain occasions.  I need to determine a mechanism to make sure that the
message is read properly.

Sai
On Sun, Jul 8, 2012 at 2:29 PM, G. Blake Meike <[email protected]>wrote:

> I am fairly certain that your problem has nothing to do with message
> passing.  The basic messaging idiom you are using works just fine and you
> can, in a few minute and a few lines of code, verify that messages are
> passed immediately, not in 60 seconds.
>
>  In particular, btw, the extra thread in your implementation is kind of
> pointless.  The Handler can easily just reschedule itself each time it is
> called.  That also makes it much easier to handle onPause and onResume...
> which, I assume, is something of concern to you.
>
> I know you didn't ask but, IMO, your code could use some serious
> reorganization.  That sure would make it easier for me to find the
> problem... and it might even make it easier for you to find it.
>
> I believe that the actual "message passing" happens through the data
> member "m".  You should be certain that it is being accessed from only one
> thread -- that the code in the case statement runs in the same thread as
> the Handler.
>
> G. Blake Meike
> Marakana
>
> The second edition of Programming Android is now on-line:
> http://shop.oreilly.com/product/0636920023005.do
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" 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-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en

Reply via email to