connecting 2 devices

hi all,

I’m starting 2 apps that will have this features:

app n.1 , will have a QR code on the screen. (interactive table using android)

app n.2, will have a QR code reader (user with smartphone having android or IOS) (going to buy QR code reader plugin if I resolve this problem).

app n.2 will have a login system to identify each user (that part is already done). after he logins, it will be provided the QR code reader so he can connect to app n.1.

The user of app n.2 should pass the scanner on QR code of app n.1, it should send to app n.1 that he’s trying to connect to it. app n.1 will detect that someone is trying to connect to itself and will let him connect if it’s a valid request.

App n.1 after validating the request  (this should be done without human intervention) will change screen and provide options so user from app.n2 can use the app n.1.

the idea is having a sort of validating so the user from a smartphone can use the interactive table with the user login.

never used this kinda of approach. what should i learn?

this looks a p2p problem, with corona will i’m being able to do this? (lua socket, udp, tcp?) or do i need some sort of external service like a server with p2p capability like turn based games, or chart rooms. or i’m complicating and it can be done easier that this.

regards, Carlos.

Hi Carlos,

My brother is developing a multiplayer quiz game and found that using appWarp and by connecting two devices to a room, sending info between them is a oneliner.

Perhaps that could be used with your scenario?

Anaqim

Hi anaqim,

Thanks for you input.

I think i can go with appWarp route, but before going to external services, i’m open to see if anyone gives me directions only using corona (if this can be done).

regards,

Carlos.

I’m a bit confused about what the overall goal is that you’re trying to accomplish.

Are you wanting to do a multi-player game where people are in the same room? Is App1 acting as a game server and others as clients?

What can you tell me about this at a higher level?

Rob

this is not a game. it’s a business app. but the connection can be like a multi-player game like you suggest app 1 as a game server and other as clients but its more a 1-1 connection. only 1 client can be connected to the server at one time.

app 1 will be an interactive table.

app 2 will be the client smartphone app.

app 1 will be the “server” that is waiting for someone to connect it, with the QR code to identify it. There will be more interactive tables in other places each with their own QR code but only one client can connect to 1 table. 

when app 2 connects to app 1, app 1 will unlock a menu with products that you can buy from.

what i want to do is the connecting part. everything else is already almost finished.

i could do something like this:

app 1, will have a timer with 1s interval, doing a request to a server to check if someone is trying to connect to it.

app 2 when i point with the QR code reader to the app 1 Qr code, it will send to the server info about the user a permission on to connect.

since app 1 is “waiting” it will check the server each second,…if the state on the server changes…it will connect to the user that is stored on the database.

i don’t believe this is the correct approach. multi-user players must just a better approach to connect 2 users than this, so if anyone is comfortable with connecting users could help me so i could implement a better solution than this.

sorry about my bad explanation of my problem. i try to explain the best with my bad english.

Where do you intend App 1 to run (the server)? On someone’s phone? A network connected desktop?  Why can the server only take one connection at a time?

like i said, app 1 will be running in a interactive table like this one:

http://www.partteams.com/?page=queue_management

one lookalike “Quartz dispenser” model. it will run android behind it.

it will have only one connection because the screen of the interactive table will have personalize menu to the user that is connected to.

after the login, the app 1 will know who the user is, and will provide options according to that person. like i said 1-1 connection.

Is it wifi connected? bluetooth? nfc? How much control do you have over the app running on the device?

Rob

app 1 will be wifi connected but app 2 can have 4G, or wifi, depending on the place. they could be on different networks if your asking about that. nfc, not all devices have it, camera they all have thats why i choosed qr code approach. but you could convince me to use nfc if its a better approach.

i’ve 100% controll of both apps…i’m building the 2.

what i want its something like this:

https://www.youtube.com/watch?v=gWDtQAXIu0I

If you’re going to be WiFi connected, you could look into use Autolan. It lets you setup TCP/IP connectivity between devices. There is also a ZeroConf plugin that makes discovering network devices easier. Once you’re connected, you can then do socket level communications to pass a message from the phone to the kiosk after  it scans the QR code.

At that point you would be authenticated.

Rob

The 2 users can be on the same network, but they also can be on different networks. A call to a remote server will always be needed (middle man). I just need an effective way to the “server” (the interactive table) to “listen” for a remote request and accepted it. what i need is to the app 1 to connect to the remote server and wait for a “join” request, after a positive request from app 2, it will start an 1-1 connection not accepting any more requests till the connecting is closed on app 1.

I still think a combination of the ZeroConf plugin and AUTOLAN may be your solution. ZeroConf can help your customers discover the kiosk and once you’ve not network addresses, your customer app can open a connection to a server running in your kiosk app.

Rob

i will give it a try Rob, thanks for the advice.

Hi Carlos,

My brother is developing a multiplayer quiz game and found that using appWarp and by connecting two devices to a room, sending info between them is a oneliner.

Perhaps that could be used with your scenario?

Anaqim

Hi anaqim,

Thanks for you input.

I think i can go with appWarp route, but before going to external services, i’m open to see if anyone gives me directions only using corona (if this can be done).

regards,

Carlos.

I’m a bit confused about what the overall goal is that you’re trying to accomplish.

Are you wanting to do a multi-player game where people are in the same room? Is App1 acting as a game server and others as clients?

What can you tell me about this at a higher level?

Rob

this is not a game. it’s a business app. but the connection can be like a multi-player game like you suggest app 1 as a game server and other as clients but its more a 1-1 connection. only 1 client can be connected to the server at one time.

app 1 will be an interactive table.

app 2 will be the client smartphone app.

app 1 will be the “server” that is waiting for someone to connect it, with the QR code to identify it. There will be more interactive tables in other places each with their own QR code but only one client can connect to 1 table. 

when app 2 connects to app 1, app 1 will unlock a menu with products that you can buy from.

what i want to do is the connecting part. everything else is already almost finished.

i could do something like this:

app 1, will have a timer with 1s interval, doing a request to a server to check if someone is trying to connect to it.

app 2 when i point with the QR code reader to the app 1 Qr code, it will send to the server info about the user a permission on to connect.

since app 1 is “waiting” it will check the server each second,…if the state on the server changes…it will connect to the user that is stored on the database.

i don’t believe this is the correct approach. multi-user players must just a better approach to connect 2 users than this, so if anyone is comfortable with connecting users could help me so i could implement a better solution than this.

sorry about my bad explanation of my problem. i try to explain the best with my bad english.

Where do you intend App 1 to run (the server)? On someone’s phone? A network connected desktop?  Why can the server only take one connection at a time?

like i said, app 1 will be running in a interactive table like this one:

http://www.partteams.com/?page=queue_management

one lookalike “Quartz dispenser” model. it will run android behind it.

it will have only one connection because the screen of the interactive table will have personalize menu to the user that is connected to.

after the login, the app 1 will know who the user is, and will provide options according to that person. like i said 1-1 connection.