-1

I wish to create a Cordova/Android app that will be called/executed from my server. Both devices are on the same intranet and connect via WiFi, therefore no cloud messaging required . For another scenario I have done the opposite. i.e. Android calls, via Ajax, an application on a Raspberry Pi for door opening purposes but this time I want to call an Android application from a Raspberry Pi. Where do I start? Ajax? Socket Server? What is the recommended connection method?

1 Answer 1

0

I think that websockets are the way to go. Implementing such a real time application allows you to 'push' data from the server to connected clients.

This can be initiated by clients (like in a chat application) but also by the server based on whatever events.

Have a look at Primus as a possible implementation. It abstracts the functionality from the websockets layer. This way it is possible to work with different websocket implementations.

Sign up to request clarification or add additional context in comments.

6 Comments

To make my story a little more complicated, after being called, I want the Android application to take a photograph and send that back to the server, then wait for next call. I thought Ajax might serve the purpose.
Thats perfectly possible with websockets. As soon as data arrives from the server it can be interpreted and reacted upon. Messages (e.g) as JSON objects) can be send back and forth.
I have created a websocket application but when I attempt to connect to it from another device I get "connection refused".
BTW My app is based on what I found at stackoverflow.com/questions/25464614/…
I have attempted doing something similar but I get "connection refused" when I attempt connecting from my server?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.