ip地址定位2
来源:互联网 发布:苹果笔记本mac有光驱吗 编辑:程序博客网 时间:2024/04/30 02:49
1、淘宝
JSONObject obj2 = obj.getJSONObject("data"); String code = obj.getString("code"); if (code.equals("0")) { result = obj2.getString("region") + ","+obj2.getString("city"); } else { }
2、新浪
String[] temp = returnStr.split(","); String provice = temp[4]; if(provice!=null){ String[] province2 = provice.split(":"); provice = province2[1]; provice = provice.substring(provice.indexOf("\"")+1, provice.lastIndexOf("\"")); } String city = temp[5]; if(city!=null){ String[] city2 = city.split(":"); city = city2[1]; city = city.substring(city.indexOf("\"")+1, city.lastIndexOf("\"")); } result = decodeUnicode(provice)+"省,"+decodeUnicode(city)+"市";
3、腾讯
JSONObject jsonobject = JSONObject.fromObject(result); TxApi api = (TxApi)JSONObject.toBean(jsonobject,TxApi.class); result = api.getResult().getAd_info().getProvince()+","+api.getResult().getAd_info().getCity();
4、高德
JSONObject obj = JSONObject.fromObject(returnStr); result = obj.getString("province")+","+obj.getString("city");
5、搜狐
String returnStrs[] = returnStr.split(","); returnStr = returnStrs[2]; String returnStrs2[] = returnStr.split("\""); result = returnStrs2[3];
5、百度
JSONObject obj = JSONObject.fromObject(returnStr); BaiduMap api = (BaiduMap)JSONObject.toBean(obj,BaiduMap.class); result = api.getContent().getAddress_detail().getProvince()+","+ api.getContent().getAddress_detail().getCity();
下载地址:链接:http://pan.baidu.com/s/1i5wVRnf 密码:br99
全CSDN的丰(好)色(se)博客,这里有书本看不到的Java技术,电影院禁播的电影,欢迎关注QQ群494808400
0 0
- ip地址定位2
- IP地址定位
- ThinkPHP IP地址定位
- 百度ip地址定位
- IP地址定位
- ip地址定位
- 通过IP地址定位位置
- 根据IP地址定位城市
- 百度地图定位和IP地址定位
- Java实现IP地址定位地址信息
- QT通过IP地址定位地址
- IP问问:IP地址定位术语
- 利用腾讯的ip地址库做ip地址定位
- ThinkPHP中IP地址定位,包括IP地址库文件
- Cisco Switch IP 地址错误定位
- 根据IP地址对访问者定位
- 局域网 有IP地址定位主机
- 利用Google API 进行IP地址定位
- Linux系统内存管理之伙伴系统分析
- 三、简单刷题APP(题库是Excel)之在APP添加题目
- Fragment的调用方式
- 最短路径的两种算法
- 仿printf实现
- ip地址定位2
- 基础测试理论与实践-连载(一):写的背景与动机
- bash 基本技巧
- Android 7.1.1 之实现 3D Touch
- 【Java之容器】1.Map基本用法
- laravel 访问时路径前老是要加个public
- 泛型
- 链表
- android 如何判断app 运行在后台