Android Question What solution is prefered?

nazilabdulla

Member
Licensed User
Longtime User
I can explain one scenario , please explain what solution I should choose..

Computers and mobile devices are different network and connected to internet. Need to communicate between these devices. I have one static IP server to route it.

If I use HTTP , only one side communication can do
Please let me know what solution need to prefer?
 

KMatle

Expert
Licensed User
Longtime User
Use FCM (Firebasemessaging: DATA messages). WhatsApp, Facebook and other apps use it too. There are tons of examples here (and Google itsself). With it you can send messages to devices via Google servers (it's free!) from php or via an OKHttpUtils call.
 
Upvote 0

Brandsum

Well-Known Member
Licensed User
I can explain one scenario , please explain what solution I should choose..

Computers and mobile devices are different network and connected to internet. Need to communicate between these devices. I have one static IP server to route it.

If I use HTTP , only one side communication can do
Please let me know what solution need to prefer?
You can use websocket or socket.io for peer to peer communication in realtime.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Or depending on the situation, MQTT can work. Broker runs on where the server with static IP is, or you can use an online broker service.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
Upvote 0

nazilabdulla

Member
Licensed User
Longtime User
Use FCM (Firebasemessaging: DATA messages). WhatsApp, Facebook and other apps use it too. There are tons of examples here (and Google itsself). With it you can send messages to devices via Google servers (it's free!) from php or via an OKHttpUtils call.

Is FCM working for windows also ? I think Firebasemessaging can do only for mobile devices, please confirm it . Because Some times I need to call windows device also
 
Upvote 0

nazilabdulla

Member
Licensed User
Longtime User
Or depending on the situation, MQTT can work. Broker runs on where the server with static IP is, or you can use an online broker service.

For the MQTT we have to depend third party as Broker. That is the problem. Can we easily make our own online broker ?
 
Upvote 0

nazilabdulla

Member
Licensed User
Longtime User
if u use b4j & Jetty Server u can use web sockets, its bidirectional.
if your apps (b4a/b4j) share the same class file you can use B4XSerializator.
if u transfer data via internet you need https & ssl certificate.

https://www.b4x.com/android/forum/threads/b4x-network-asyncstreams-b4xserializator.72149/

https://www.b4x.com/android/forum/t...device-desktop-and-web-reports.37254/#content

Can u please confirm that server is able to call client ? I think Data can Send/Receive from client only. Please confirm it
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Is FCM working for windows also ?
No.
For the MQTT we have to depend third party as Broker.
No. You can implement a broker in a B4J Server app. Where is the problem?
Sure you need to depend on 3rd party jar. But they are free to use.
You dont need to depend on any 3rd service.

I suggest to use a mqtt broker on your static ip machine running a b4j server app (implementing the broker).
All clients connect to the broker (even windows client) and listen to topics (or how this is called in mqtt (never used it so i´m not really familar))...
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
Can u please confirm that server is able to call client ? I think Data can Send/Receive from client only. Please confirm it

because server have a known fix domain name and there is a app that runs 24/7, the client app need connect first then you can send data in both directions via web sockets.
client app is always startet on demand.
 
Upvote 0
Top