简体   繁体   中英

Will the android server address for my local server(wamp) change?

I have set up a wamp server, but i have changed the port to 82 since 80 was already used by something else. Now i have an android app which takes the server address as 10.0.2.2. I have put the address as this. But this doesn't work. Will the server address have to be changed due to changed port number. If yes, then what will be the correct address through which I can access my php files.

You need to specify the port in adress

URL url = new URL("10.0.2.2:82");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(url.openStream()));

You should have read about the networks before you start programming...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM