M
M
mitaichik2021-01-20 16:03:44
Android
mitaichik, 2021-01-20 16:03:44

How to turn application into http-server?

Hello!

The task is: you need to send a command from the server to the application (launched on the phone), the application must do it (for example, send SMS) and send a response to the server. The speed should be high, so all sorts of things like firebase are superfluous, and the phone is in the same LAN with the server.

I see 2 ways:

- Application as a client: the application is launched - a WebSocket connection is made to the server, through which the server sends commands.

- Application as a server: the application receives the rest of the request and returns the response.

In your opinion and experience, which option is preferable? And a common question for both options is how to ensure that the application works unambiguously on the phone?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mitaichik, 2021-11-08
@mitaichik

In general, from the local local area, you can safely access the phone by ip.
You write an application in which the web server is included (you use https://ktor.io/ )
You shove it into the background service
And calmly access it
There are no problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question