模拟器跟真机连接tomcat的区别

模拟器和真机连接tomcat的区别
//系统要连接的WebService接口地址
private static final String NAME_SPACE_SALE = "http://wf.cn.silent.com/";
//模拟器的连接地址
private static final String END_POINT_SALE = "http://10.0.2.2:8080/PhoneSell/ws/clientService";
//真机的连接地址
private static final String END_POINT_SALE = "http://192.168.1.120:8080/PhoneSell/ws/clientService";

android模拟器(simulator)把它自己作为了localhost,也就是说,代码中使用localhost或者127.0.0.1来访问,都是访问模拟器自己,所以,如果是调试器 10.0.2.2(不能改变) 本机地址;真机上:则是路由器中电脑地址,而且,必须是手机和电脑都要用wifi连接到无线路由上,一定要在同一网段。