B4J Question Best Communication Method between Android and Desktop App

dieterp

Active Member
Licensed User
Longtime User
I want to develop a B4J app that will receive a request and then perform a key press event through code. The request will be sent via a B4A app. I understand that I can use an API to post the request from the B4A app and then have the B4J app get the response, but there will be a delay of maybe 2-3 seconds and I'm trying to get the process as instant as possible.

Is there a quicker way for the B4A app to connect/communicate with the B4J app so that there won't be any delay?
 

Xfood

Expert
Licensed User
Longtime User
try to take a look here

 
Upvote 0
Solution

emexes

Expert
Licensed User
Longtime User
UDP

Although, from memory, it's not guaranteed. But in practice, on working networks, I've never had a problem yet.

It is included with both B4A and B4J (probably B4I and B4R too) so there's no (additional separate) API.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
As long as you realize that UDP is a sessionless protocol, where speed and efficiency are more important than perfect reliability: there is no control over the correct arrival of the sent packets.
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
there is no control over the correct arrival of the sent packets.
in practice, on working networks, I've never had a problem yet.

Those reliability and out-of-order issues only seem to happen when packets travel across the stormy medium of the internet.

Across local networks - and probably any situation where there are not multiple paths - I have found that UDP works just great.

But if the phone is working via mobile phone internet, then sometimes a packet will take the scenic route or be otherwise delayed.
 
Upvote 0
Top