简体   繁体   中英

Baiscs about sending data from device through wifi to server to execute command

I have tried both Google and the questions here to get an answer from which I could proceed from. What I would like help with is not very specific which I assume is the reason why an answer is hard to search for. Anyway, I wonder what way would be the easiest (best) way to set up a server, running windows, to which I from a an android application could send data, through the local WiFi, so that the server then uses the data (information) to perform certain commands. I'm looking to use java in the application (ofcourse) and in the program on the server which executes the commands. What I therefor would like help with is what I would use on the server to receive the send data from the android device and with that use my java-program to execute the commands required.

If they need to be coded separately my goal is to combine the application performing the commands in the computer with the program receiving the data from the device. The use would look like this: The user downloads the application to the device and also the serverapplication (combined if that was the case) to his/her computer. He starts the complete serverapplication on the computer (without needing to perform any complicated configurations) which starts running and then uses the android application on the device to perform the things on the server which it intends to do.

I hope it is understandable and an acceptable question. And to clarify, I'm not looking for complete codes or a solution for the entire thing (unless someone is willing to share some ideas and methods) but instead just the most suitable languages and so on to be used in order to achieve what I want to achieve.

You say very little about what kind of data you want to send, but a generic and fairly flexible solution is to use a REST API for the server application. I recommend you have a look at DropWizard ( http://dropwizard.codahale.com/getting-started/ )

This doesn't address how to make the calls from Android but it will get you started on the server side of things.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM