Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6713
  • 博文数量: 2
  • 博客积分: 160
  • 博客等级: 入伍新兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-30 19:48
文章分类
文章存档

2014年(1)

2013年(1)

我的朋友
最近访客

分类: Android平台

2013-10-12 00:26:17

今天帮助朋友找人时研究了下手机定位,先说一下C网的。

Andriod手机可以用*#*#4636#*#* 或 *983*0#手动获取手机登记的基站位置Lat Long

如图



得到LAT和LONG后,用下面的代码获取对应的经纬度

点击(此处)折叠或打开

  1. /**
  2.  * Latitude is a decimal number asspecified in 3GPP2 C.S0005-A v6.0.
  3.  * It is represented in units of 0.25seconds and ranges from -1296000
  4.  * to 1296000, both values inclusive(corresponding to a range of -90
  5.  * to +90 degrees). Integer.MAX_VALUEis considered invalid value.
  6.  */

  7. /**
  8.  * Longitude is a decimal number asspecified in 3GPP2 C.S0005-A v6.0.
  9.  * It is represented in units of 0.25seconds and ranges from -2592000
  10.  * to 2592000, both values inclusive(corresponding to a range of -180
  11.  * to +180 degrees).Integer.MAX_VALUE is considered invalid value.
  12.  */
  13. #include <stdio.h>
  14. int main()
  15. {

  16.         int iLat = 0x6a1d0;
  17.         int iLong = 0x1a65e2;
  18.         double fLat = (double)iLat * 90 / 1296000;
  19.         double fLong =(double)iLong * 180 / 2592000;
  20.         printf("lat=%lf long=%lf\n", fLat, fLong);
  21. }


$ ./a.out
lat=30.183333 long=120.140139

好了,现在直接用Google地图/地球搜索 30.183333 120.140139,怎么样,找到了吧,呵呵

上面只是验证过程,在手机中手动获取LAT和LONG,程序实现可以调用现成的函数获取对应经纬度的整数值,然后再转换成经纬度
CdmaCellLocation.getBaseStationLatitude()
CdmaCellLocation.getBaseStationLongitude()

从核心网侧获取用户位置的信令应该也有的,等改天有时间再补上。


阅读(382) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:curl常用操作集锦--持续更新

给主人留下些什么吧!~~