Android Question B4A server to interact with cordova app

mmanso

Active Member
Licensed User
Longtime User
Hi all,

I've a customer which will build a cordova application and he needs to interact with hardware devices. He asked me if I could write some kind of server in Android that will receive requests and interacts with the hardware (instead of writing cordova plugins).

Let's imagine he has a network printer or a bluetooth printers for example. Instead of connecting to the device he would use an API writting in B4A and running on the android device that would deal with the hardware part.

Is this possible with B4A? What would be the right approach?

I wouldn't do this with B4J because the application might run offline (with no network connection) and on a single android machine (without a desktop computer to have a B4J server running).

Thanks in advance.
 

mmanso

Active Member
Licensed User
Longtime User
Hi,

thanks for the answer.

This wouldn’t be the case. Imagine in my Cordova app I have a string I need to print and I would like to have a local api (http, for example) where I could call a “print” method, pass it the string and the B4a server would get that and deal with the printer to print.

something like this...
 
Upvote 0

mmanso

Active Member
Licensed User
Longtime User
Would be http better than mqtt? I’ve read something about having a mqtt broker in android also...
 
Upvote 0
Top