About Asynchronous Communications from Android

Asked 1 years ago, Updated 1 years ago, 86 views

About Android Asynchronous Communications
I'd like to make it possible for Android to communicate over the network and switch on and off the sensors at home, but I'm worried about what kind of system I should configure.

The destination sensor is controlled by the real-time operating system, T-Kernel.

So as a configuration, I would like to send data from Android and send a signal directly from that server to T-Kernel. Is this possible?

java android network http

2022-09-30 20:53

1 Answers

As a precondition,
* Your home is always connected to the Internet
* Also, the global IP is fixed, or names can be resolved through DynamicDNS etc.)
* TCP/IP communication available in your home (with LAN)
Answer as

The conditions for relaying servers are that they can communicate with T-Kernel through some protocol and Android through some protocol.

I am not familiar with T-Kernel, but it seems that socket communication is possible, so I think it would be better to use HTTP daemon (for example, NanoHttpd on java) that can be handled in socket communication language on RaspberryPi to relay.
* Android→ Transit Server: http
* Transit Server → T-Kernel Device: Socket Communication (per java.net.Socket Class for java)

I chose Http as the communication method from Android because it is easy to test with a browser.
I think you need to configure the firewall and NAT as well because you need ports to be exposed to the WAN side.Depending on the functionality, you will need to take some security measures.


2022-09-30 20:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.