关于JSON解析IP的问题 [英] Question about JSON parsing IP

查看:171
本文介绍了关于JSON解析IP的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一个问题,我们在URL中使用的IP地址从WCF获取数据到URL中的URL我们给IP而不是localhost哪种IP或者是PC或者android模拟器

提前感谢..........









HttpClient客户端;

final static String URL =" http://192.168.1.6/RPersonService/PersonService.svc/personsdata" ;;

JSONObject json ;

解决方案

PC的IP。

由于模拟器是虚拟机,因此无法与localhost服务通信。这就是我们托管服务的原因。
当您在机器上托管服务时,您的PC就成了服务器。



-KR

i want to ask one thing that the IP address which we use in URL to get data from WCF to android in URL we give IP instead of localhost which kind of that IP either of pc or android emulator
thanks in advance..........




HttpClient client;
final static String URL="http://192.168.1.6/RPersonService/PersonService.svc/personsdata";
JSONObject json;

解决方案

PC's IP.
As emulator is a virtual machine, it can't communicate with the localhost service. That's why we host the service.
Your PC becomes the server when you host the service on your machine.

-KR


这篇关于关于JSON解析IP的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆