As you've discovered, localhost / 127.0.0.1 means "this host" and is only useful for talking to the same host that your app resides on. If you want to talk to another local machine from a separate Android device this won't help you.
If I'm understanding you correctly you're trying to do an HTTP Get request to a different server on the local network. I'm not sure there is a 'magic bullet' way of discovering services locally though many protocols have been developed to try to overcome this over the years including many based on DNS, UDP, multicast, Bonjour and previously discovery for SOAP services etc.
Many threads exist around best ways to discover services locally (including from from Android specifically) which may help you...
https://softwareengineering.stackexchange.com/questions/244728/best-strategy-to-discover-a-web-service-in-a-local-network
Device discovery in local network
I've not used them but a search turned up these (Simple Service Discovery Protocol, ZeroConf)...
https://github.com/Yortw/RSSDP
https://github.com/onovotny/Zeroconf
The simplest method could be to allow the user to provide a hint at runtime.. eg, ask for the IP of the server in a simple dialog on first run or in settings / preferences / config file etc. I've often used that for apps in order to speed up development with a view to introducing auto discovery later. YMMV of-course.
HTH
ps. Please go easy on me other StackOverflow'ers, this is my first ever reply :-)