I am doing a android project. I want to connect my client(android phone) using ip address to my laptop(server). I am using ip address of wireless modem(MTS). Each time i reconnect the ip address changes. So how can I keep this ip address constant so that only one ip address can be used for connection via wireless internet connection?
migrated from stackoverflow.com May 13 '12 at 5:47
This question came from our site for professional and enthusiast programmers.
The ip-address of your modem is given by your provider and will most likely change everytime you reconnect.
So my answer would be you can´t. This makes the question far off topic, you might wanna take it off.
If client IP is fix then here's an approach
1)Write a code listening to port in android client 2)In the server, write a client to connect to android port send the server IP to the android
Then you can continue with your normal approach
You can use UPNP for your case where upnp server broadcast its info to all the clients in the network.But implementation will be a bit extensive in this case.