关于电信天翼机的CDMA基站定位方法
最近在写一个项目,使用到定位应用 。由于电信机型无法使用Android sdk中的LocationManager进行定位,只能另外写了一个使用Cellinfo进行定位的函数,测试过CoolPad手机是可以获取到位置,但在一款新的三星机上就无法进行定位了,它屏闭了mobileNetworkoperator,得出来竟然是空值。无耐中只能自己填写对应的国家码460,位置是取回来了,但偏差不是一般大。超过2公里。if (type == TelephonyManager.NETWORK_TYPE_CDMA
|| type == TelephonyManager.NETWORK_TYPE_1xRTT
|| type == TelephonyManager.NETWORK_TYPE_EVDO_A
|| type == TelephonyManager.NETWORK_TYPE_EVDO_0) {
cdma = ((CdmaCellLocation) manager.getCellLocation());
try {
if (cdma == null) {
Utility.WriteLog(TAG, "celllocation is null");
return null;
} else {
Utility.WriteLog(TAG, "celllocation is not null");
int sid = cdma.getSystemId();// 系统标识 mobileNetworkCode
int bid = cdma.getBaseStationId();// 基站小区号 cellId
int nid = cdma.getNetworkId();// 网络标识 locationAreaCode
// Log.i("sid:", "-" + sid);
// Log.i("bid:", "-" + bid);
// Log.i("nid:", "-" + nid);
Utility.WriteLog(TAG, "Nid:" + nid);
CellIDInfo info = new CellIDInfo();
info.cellId = bid;
info.locationAreaCode = nid;
info.mobileNetworkCode = String.valueOf(sid);
String ss = manager.getNetworkOperator();
Utility.WriteLog(TAG, "networkoperator:" + ss);
if (ss == null || ss.length() == 0) {
info.mobileCountryCode = "460";
//info.mobileCountryCode = "03";
} else {
info.mobileCountryCode = manager.getNetworkOperator()
.substring(0, 3);
// info.mobileCountryCode = manager.getNetworkOperator()
// .substring(3, 5);
}
info.radioType = "cdma";
CellID.add(info);
return CellID;
这是其中获取CDMA基站信息的代码。
也尝试过使用
double lat = (double) myCDMACellLoc
.getBaseStationLatitude() / 14400;
double lon = (double) myCDMACellLoc
.getBaseStationLongitude() / 14400;的方法,但回来的经纬度应该是受加密的。不能被使用。
不知道有没有高手可以解决到CDMA 室 内定位的问题,感谢。 --------------------编程问答-------------------- 可以找解密的公式,算出原始的位置。 --------------------编程问答-------------------- 是指对double lat = (double) myCDMACellLoc
.getBaseStationLatitude() / 14400;
double lon = (double) myCDMACellLoc
.getBaseStationLongitude() / 14400;的方法,进行解密的公式吗? --------------------编程问答-------------------- 估计要调用 189应用 接口才能使用定位 --------------------编程问答--------------------
189随便使? --------------------编程问答-------------------- 哎呀楼主,我也正在被这个问题困扰!我们的思路机会碰到一起了,同样的困难啊。。。郁闷 --------------------编程问答--------------------
围观 --------------------编程问答-------------------- 189应用 接口才能使用定位 --------------------编程问答--------------------
请问是哪个接口,我在上面搜了下,没发现定位相关API。是不是需要申请开发者才能看到? --------------------编程问答-------------------- 不好意思最近忙于上传 APP到苹果了,足足弄了三天。这过程太痛苦。所以没上来看。
关于CDMA定位的问题,我咨询了电信内部,189是提供了接口,但这个并没开放给普通开发者,因为这个工信部还没批下来。目前,可以在这些特殊CDMA手机上定位的只有以下几个应用,是我自己测试的。
大众点评网
百度地图
我测试了大概有五十个与位置有关的应用。也只有他们能做到。其它暂时没测试。
这两 个应用不可反编译,估计是用C直接写库了。 --------------------编程问答-------------------- LZ问题解决了吗,
double lat = (double) myCDMACellLoc
.getBaseStationLatitude() / 14400;
double lon = (double) myCDMACellLoc
.getBaseStationLongitude() / 14400;
用这个方法,在同一个地方会得到不一样的结果,而且误差很大
补充:移动开发 , Android