Question

My question isn't necessarily on how to do this - rather I'd really like to know where to start. I've made a program in Java that keeps track of a dart game. I have a core DartGame class and classes for the different games that inherit it. From there it keeps track of players, who's turn it is, the current score, etc. It works great now what I want to do is make it into an Android app. I have a server program on my computer that would link the running apps. I don't want a global server that can be accessed anywhere because I don't want to spend the money on a VPN server, so the server program would just run on my PC. An example of a similar type of server would be like the one used for AndroMouse which allows you to control the cursor on a PC with an Android device.

What is the best way to make the connection from the device to the PC? I'm not sure if it uses a MAC address or the WIFI from my router, or even Bluetooth is an option. I'm not really familiar with Android but I assume there would be some sort of Server/ServerSocket connection, but that requires an IP address and I'm not sure which one to use. Is it as simple as using the local IP from my router? Like I said I'll learn how to do it on my own, I'd just like to know what I need to learn before I spend a bunch of money on Android books. Thanks in advance.

Was it helpful?

Solution

If your pc and your device are in the same LAN, just create socket to communicate through wifi connection. Otherwise, you should choose bluetooth I think. I think the

If they are not in the same LAN, then it is a little bit difficult. MAC address is meaningless unless in LAN.

AndroMouse also uses bluetooth connection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top