how to connect any local server with unity andriod application ?
how to connect with local server please tell with whole procedure?
Answer by vbvasare · Oct 01, 2019 at 02:52 PM
can you please provide with a complete code??
I added links to some Game Server examples. You will need to adapt it to your needs
Answer by Mouton · Sep 29, 2019 at 06:05 PM
It really depends of the server application you want to use.
Basically, you have to do at least the following. Steps with stars (*) may be optional, depending of the framework you use.
Server
Write the code for the server
*If the server application do some host verification, add to the allowed hosts the IP of the network card connected to your router
*Forward external port on your system to server port
*Create firewall rules to allow traffic on this port
Run the server on your local machine, it should listen on a specific port (internal)
Client
Write the code to communicate to the server, you can hardcode the server ip:port as long as you are debugging, but don't do this in production
Build your application
Install it on the android device
Run it, if your setup is correct, you should get an answer from the server to your requests
Server examples
You can find full working example of game servers written in .Net Core on GitHub. You should adapt it to your needs:
Your answer
Follow this Question
Related Questions
UNITY PROBLEM 2 Answers
What is difference between Network.InitializeServer and Unet. please help me 0 Answers
Can't connect to server 0 Answers