I need to get my router's public IP but due to unreliable Internet connection I can not use web services like http://automation.whatismyip.com/n09230945.asp (this approach fails in most cases). Is there a way to get my public IP directly from my router (or maybe another way to get it without using Internet connection)? Any links are appreciated.
Updated: I have java client/server application with the server part in my home PC and the client part in my phone. My home PC's public IP is dynamic so I periodically need to get my new IP. When my server's IP is changed it can tell it the client part.