Android Question Panel_Touch Action 1 Does not always fire

lip

Active Member
Licensed User
Longtime User
I am using Panel_Touch Action 1 to fire a sub that sends a message via bluetooth. A response is received via bluetooth within about 0.2 seconds. The AStream_NewData sub stores the response into a SQL database. This all works fine.

If I touch the panel a second time (ie a double tap) then Action 0 ALWAYS fires but the Action 1 fires intermittently. It seems to depend on the timing of the response from Bluetooth. This suggests that Action 1 only fires if the processor is not busy doing something else?

I have declared the sub Panel_Touch as Boolean and return True at the end of the sub.

Any ideas?
 

thedesolatesoul

Expert
Licensed User
Longtime User
I cant remember what action 1 is but,
B4A apps are single threaded, if the processor is busy processing your bluetooth data you can experience UI lag like you are seeing. However, Asyncstreams itself fetches the data from another thread , so it depends on what you are doing with the data after you receive it.

Declaring and returning true in panel touch only lets other views underneath it to receive the event.
 
Upvote 0

lip

Active Member
Licensed User
Longtime User
I cant remember what action 1 is but,
B4A apps are single threaded, if the processor is busy processing your bluetooth data you can experience UI lag like you are seeing. However, Asyncstreams itself fetches the data from another thread , so it depends on what you are doing with the data after you receive it.

Declaring and returning true in panel touch only lets other views underneath it to receive the event.

Action 0 = Touched, Action 1 = Released, Action 2 = Moved. When you say "UI lag" does that mean that if the processor is busy it will not sense the event? Or should it just delay it?
 
Upvote 0
Top