There are many answers here, but I found them messy or incomplete. To start a local server on your computer and test it using a real device, follow these steps:
1) Add httpAddress = "0.0.0.0" to the appengine block in the build.gradle file of the backend module (Google Cloud Endpoint), for example:
appengine { ... httpAddress = "0.0.0.0" }
According to the commentary on the question, this means that "will take from anywhere."
2) Run your server module locally (i.e. start the web server). This is trivial: select the backend configuration from the drop-down menu and click the green button. You can find more detailed instructions here .
Now you can open a browser (on your computer) and go to http://localhost:8080/ and browse the web page using "Hello, Endpoints!". and much more.
3) Find the IP address of your computer (on a Mac, go to System Preferences → Network), and then set it as the root URL in the code of the Android application, for example:
MyApi.Builder builder = new MyApi.Builder( AndroidHttp.newCompatibleTransport(), new AndroidJsonFactory(), null ).setRootUrl("http://192.168.1.36:8080/_ah/api/")
What all!
source share