【发布时间】:2013-10-28 04:05:49
【问题描述】:
我想从我的应用程序中访问用户使用他想要的任何浏览器访问的页面的信息。是否有可能在 android 上做到这一点,如果可以,怎么做?
【问题讨论】:
我想从我的应用程序中访问用户使用他想要的任何浏览器访问的页面的信息。是否有可能在 android 上做到这一点,如果可以,怎么做?
【问题讨论】:
不确定android,但在java中你可以通过以下方式进行
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if (ipAddress == null) {
ipAddress = request.getRemoteAddr();
}
System.out.println("ipAddress:" + ipAddress);
查看原答案here
【讨论】: