`
jackle_liu
  • 浏览: 147839 次
文章分类
社区版块
存档分类
最新评论

Get CellId and other Imformation from mobile phones via J2ME

阅读更多

原文出处:http://www.easywms.com/easywms/?q=zh-hant/node/3589

 

Without GPS or Network Operator we can still use the Location Based Service, via the help of CellId(Cell ID the location of Cell Identities of GSM-networks). Google has one enormous database of cell ids which are linked to a longitude and latitude position, that why Google Map client know where you are even you have no embedded GPS--it is not open. But there are other opened cellid DBs that we can use freely: opencellid , mobiforge.com and http://realtimeblog.free.fr/
Ok, one we can get the cell from phone we can query the location from these cellid DB. In GSM networks, all cells in the world have a globally unique ID made up of four numbers:
cell ID, LAC, MNC, and MCC.

For example, for Motorola:
Using JavaME to obtain Cell Positioning information

  1. {
  2. ….
  3. String cellid = System.getProperty("CellID");
  4. String lac = System.getProperty("LocAreaCode");
  5. String imsi = System.getProperty("IMSI");
  6. // Example IMSI (O2 UK): 234103530089555
  7. String mcc = imsi.substring(0,3); // 234 (UK)
  8. String mnc = imsi.substring(3,5); // 10 (O2)
  9. String location = mcc + mnc + lac + cellID; // A globally unique ID for a cell
  10. }

Information from Truly Mobile JavaME Applications: Location, Media Capture, and Connectivity

But get Cellid is still limited by mobile phone platform, Sign-certificate and Operator:

Nokia
s40 3rd Fp1 edition, requers operator or manufactureer signing
S60 3rd edition, FP2(released 2008 and newer, does not work on e.g. N95),no singing required

SonyEricsson:
Java platform 7.3 or higher (released around 2006 and newer)
older phone may need firmware update (7.1->7.3)
does not work in SE symbian (ie. UIQ) or windownsmobile(Xperia X1) phone
Information from Terminal-based Mobile Positioning overview

And notice, even you use the right code and sign your application, it is still not possible to query the cellID, because some telecom-operators have limited this service.

The fowllowing J2ME code could help you, J2ME Polish Syntax is used here to make the procedure easier. The functions here is not complete, because some manufactories have not released their J2ME API documents to query the cellID. If you have some information which is not included in the codes please let me and others know, please supplement here, thx!

  1. //#if polish.Vendor == BlackBerry
  2. //#= import net.rim.device.api.system.GPRSInfo;
  3. //#endif
  4.  
  5.  
  6. /**
  7. * get the cell id in the phone
  8. *
  9. * @return
  10. */
  11. public static String getCellId(){
  12. String out = "";
  13. try{
  14.  
  15. out = System.getProperty("Cell-ID");
  16. if(out== null || out.equals("null") || out.equals(""))
  17. out = System.getProperty("CellID");
  18. if(out== null ||out.equals("null")|| out.equals(""))
  19. System.getProperty("phone.cid");
  20. //#if polish.Vendor == Nokia
  21. if(out== null ||out.equals("null")|| out.equals(""))
  22. out = System.getProperty("com.nokia.mid.cellid");
  23. //#elif polish.Vendor == Sony-Ericsson
  24. if(out== null ||out.equals("null")|| out.equals(""))
  25. out = System.getProperty("com.sonyericsson.net.cellid");
  26. //#elif polish.Vendor == Motorola
  27. if(out== null ||out.equals("null")|| out.equals(""))
  28. out = System.getProperty("phone.cid");//System.getProperty("CellID");
  29. //#elif polish.Vendor == Samsung
  30. if(out== null ||out.equals("null")|| out.equals(""))
  31. out = System.getProperty("com.samsung.cellid");
  32. //#elif polish.Vendor == Siemens
  33. if(out== null ||out.equals("null")|| out.equals(""))
  34. out = System.getProperty("com.siemens.cellid");
  35. //#elif polish.Vendor == BlackBerry
  36. if(out== null ||out.equals("null")|| out.equals(""))
  37. //#= out = GPRSInfo.getCellInfo().getCellId();
  38. //#else
  39. if(out== null ||out.equals("null")|| out.equals(""))
  40. out = System.getProperty("cid");
  41. //#endif
  42.  
  43. }catch(Exception e){
  44. return out==null?"":out;
  45. }
  46.  
  47. return out==null?"":out;
  48. }
  49.  
  50. /**
  51. * get the lac sring from phone
  52. */
  53. public static String getLAC(){
  54. String out = "";
  55. try{
  56.  
  57. out = System.getProperty("phone.lac");
  58.  
  59. //#if polish.Vendor == Nokia
  60. if(out== null ||out.equals("null")|| out.equals(""))
  61. out = System.getProperty("com.nokia.mid.lac");
  62. //#elif polish.Vendor == Sony-Ericsson
  63. if(out== null ||out.equals("null")|| out.equals(""))
  64. out = System.getProperty("com.sonyericsson.net.lac");
  65. //#elif polish.Vendor == Motorola
  66. if(out== null ||out.equals("null")|| out.equals(""))
  67. out = System.getProperty("LocAreaCode");
  68. //#elif polish.Vendor == Samsung
  69. if(out== null ||out.equals("null")|| out.equals(""))
  70. out = System.getProperty("com.samsung.cellid");
  71. //#elif polish.Vendor == Siemens
  72. if(out== null ||out.equals("null")|| out.equals(""))
  73. out = System.getProperty("com.siemens.cellid");
  74. //#elif polish.Vendor == BlackBerry
  75. if(out== null ||out.equals("null")|| out.equals(""))
  76. //#= out = GPRSInfo.getCellInfo().getLAC();
  77. //#else
  78. if(out== null ||out.equals("null")|| out.equals(""))
  79. out = System.getProperty("cid");
  80. //#endif
  81.  
  82. }catch(Exception e){
  83. return out==null?"":out;
  84. }
  85.  
  86. return out==null?"":out;
  87. }
  88.  
  89. /**
  90. * Example IMSI (O2 UK): 234103530089555
  91. String mcc = imsi.substring(0,3); // 234 (UK)
  92. String mnc = imsi.substring(3,5); // 10 (O2)
  93. * @return
  94. */
  95. public static String getIMSI(){
  96. String out = "";
  97. try{
  98.  
  99. out = System.getProperty("IMSI");
  100. if(out== null ||out.equals("null")|| out.equals(""))
  101. out = System.getProperty("phone.imsi") ;
  102. //#if polish.Vendor == Nokia
  103. if(out== null ||out.equals("null")|| out.equals(""))
  104. out = System.getProperty("com.nokia.mid.mobinfo.IMSI");
  105. if(out== null ||out.equals("null")|| out.equals(""))
  106. out = System.getProperty("com.nokia.mid.imsi");
  107. //#elif polish.Vendor == Sony-Ericsson
  108. /* if(out== null ||out.equals("null")|| out.equals(""))
  109. out = System.getProperty("com.sonyericsson.imsi");*/
  110. //#elif polish.Vendor == Motorola
  111. if(out== null ||out.equals("null")|| out.equals(""))
  112. out = System.getProperty("IMSI");
  113. //#elif polish.Vendor == Samsung
  114. /* if(out== null ||out.equals("null")|| out.equals(""))
  115. out = System.getProperty("com.samsung.imei");*/
  116. //#elif polish.Vendor == Siemens
  117. /* if(out== null ||out.equals("null")|| out.equals(""))
  118. out = System.getProperty("com.siemens.imei");*/
  119. //#elif polish.Vendor == BlackBerry
  120. if(out== null ||out.equals("null")|| out.equals(""))
  121. //#= out = GPRSInfo.getCellInfo().getBSIC();
  122. //#else
  123. if(out== null ||out.equals("null")|| out.equals(""))
  124. out = System.getProperty("imsi");
  125. //#endif
  126.  
  127. }catch(Exception e){
  128. return out==null?"":out;
  129. }
  130.  
  131. return out==null?"":out;
  132. }
  133.  
  134. /**
  135. *
  136. * For moto, Example IMSI (O2 UK): 234103530089555
  137. String mcc = imsi.substring(0,3); // 234 (UK)
  138. * @return
  139. */
  140. public static String getMCC(){
  141. String out = "";
  142. try{
  143.  
  144. if(out== null ||out.equals("null")|| out.equals(""))
  145. out = System.getProperty("phone.mcc") ;
  146. //#if polish.Vendor == Nokia
  147. if(out== null ||out.equals("null")|| out.equals(""))
  148. //out = System.getProperty("com.nokia.mid.mobinfo.IMSI");
  149. //#elif polish.Vendor == Sony-Ericsson
  150. if(out== null ||out.equals("null")|| out.equals(""))
  151. out = System.getProperty("com.sonyericsson.net.mcc");
  152. //#elif polish.Vendor == Motorola
  153. if(out== null ||out.equals("null")|| out.equals("")){
  154. out = getIMSI().equals("")?"": getIMSI().substring(0,3);
  155. }
  156. //#elif polish.Vendor == Samsung
  157. /* if(out== null ||out.equals("null")|| out.equals(""))
  158. out = System.getProperty("com.samsung.imei");*/
  159. //#elif polish.Vendor == Siemens
  160. /* if(out== null ||out.equals("null")|| out.equals(""))
  161. out = System.getProperty("com.siemens.imei");*/
  162. //#elif polish.Vendor == BlackBerry
  163. if(out== null ||out.equals("null")|| out.equals(""))//getMNC()
  164. //#= out = GPRSInfo.getCellInfo().getMCC();
  165. //#else
  166. if(out== null ||out.equals("null")|| out.equals(""))
  167. out = System.getProperty("mcc");
  168. //#endif
  169.  
  170. }catch(Exception e){
  171. return out==null?"":out;
  172. }
  173.  
  174. return out==null?"":out;
  175. }
  176.  
  177. /**
  178. *
  179. * For moto, Example IMSI (O2 UK): 234103530089555
  180. String mnc = imsi.substring(3,5); // 10 (O2)
  181. * @return
  182. */
  183. public static String getMNC(){
  184. String out = "";
  185. try{
  186.  
  187. if(out== null ||out.equals("null")|| out.equals(""))
  188. out = System.getProperty("phone.mnc") ;
  189. //#if polish.Vendor == Nokia
  190. if(out== null ||out.equals("null")|| out.equals(""))
  191. out = getIMSI().equals("")?"": getIMSI().substring(3,5);
  192. //#elif polish.Vendor == Sony-Ericsson
  193. if(out== null ||out.equals("null")|| out.equals(""))
  194. out = System.getProperty("com.sonyericsson.net.mnc");
  195. //#elif polish.Vendor == Motorola
  196. if(out== null ||out.equals("null")|| out.equals("")){
  197. out = getIMSI().equals("")?"": getIMSI().substring(3,5);
  198. }
  199. //#elif polish.Vendor == Samsung
  200. /* if(out== null ||out.equals("null")|| out.equals(""))
  201. out = System.getProperty("com.samsung.imei");*/
  202. //#elif polish.Vendor == Siemens
  203. /* if(out== null ||out.equals("null")|| out.equals(""))
  204. out = System.getProperty("com.siemens.imei");*/
  205. //#elif polish.Vendor == BlackBerry
  206. if(out== null ||out.equals("null")|| out.equals(""))//getMNC()
  207. //#= out = GPRSInfo.getCellInfo().getMNC();
  208. //#else
  209. if(out== null ||out.equals("null")|| out.equals(""))
  210. out = System.getProperty("mnc");
  211. //#endif
  212.  
  213. }catch(Exception e){
  214. return out==null?"":out;
  215. }
  216.  
  217. return out==null?"":out;
  218. }
  219.  
  220. /**
  221. * not used now
  222. * get the IMEI (International Mobile Equipment Identity (IMEI)) in the phone
  223. *
  224. * @return
  225. */
  226. public static String getIMEI(){
  227. String out = "";
  228. try{
  229.  
  230. out = System.getProperty("com.imei");
  231. //#if polish.Vendor == Nokia
  232. if(out== null ||out.equals("null")|| out.equals(""))
  233. out = System.getProperty("phone.imei");
  234. if(out== null ||out.equals("null")|| out.equals(""))
  235. out = System.getProperty("com.nokia.IMEI");
  236. if(out== null ||out.equals("null")|| out.equals(""))
  237. out = System.getProperty("com.nokia.mid.imei");
  238. if(out== null ||out.equals("null")|| out.equals(""))
  239. out = System.getProperty("com.nokia.mid.imei");
  240. //#elif polish.Vendor == Sony-Ericsson
  241. if(out== null ||out.equals("null")|| out.equals(""))
  242. out = System.getProperty("com.sonyericsson.imei");
  243. //#elif polish.Vendor == Motorola
  244. if(out== null ||out.equals("null")|| out.equals(""))
  245. out = System.getProperty("IMEI");
  246. if(out== null ||out.equals("null")|| out.equals(""))
  247. out = System.getProperty("com.motorola.IMEI");
  248. //#elif polish.Vendor == Samsung
  249. if(out== null ||out.equals("null")|| out.equals(""))
  250. out = System.getProperty("com.samsung.imei");
  251. //#elif polish.Vendor == Siemens
  252. if(out== null ||out.equals("null")|| out.equals(""))
  253. out = System.getProperty("com.siemens.imei");
  254. //#else
  255. if(out== null ||out.equals("null")|| out.equals(""))
  256. out = System.getProperty("imei");
  257. //#endif
  258.  
  259. }catch(Exception e){
  260. return out==null?"":out;
  261. }
  262.  
  263. return out==null?"":out;
  264. }

Some J2ME applications are also available:
http://www.ottaky.com/midlets.php#netmon2
http://www.cellspotting.com/webpages/cellspotting.html

Ref:
http://en.wikipedia.org/wiki/GSM_localization
http://www.paxmodept.com/telesto/blogitem.htm?id=531
http://www.slideshare.net/jaakl/terminalbased-mobile-positioning-overview-presentation
http://www.ottaky.com/midlets.php#netmon2
http://www.cellspotting.com/webpages/cellspotting.html

分享到:
评论

相关推荐

    j2me-gps.rar_JAVA GPS_gps j2me_gps 平台_j2me g_j2me gps

    Java ME(J2ME)是Java技术在移动设备和嵌入式设备上的应用平台,它为开发小型设备上的应用程序提供了标准化的环境。本压缩包"j2me-gps.rar"聚焦于在J2ME平台上实现GPS(全球定位系统)功能。下面我们将详细探讨J2ME...

    Java-ME-get-IMEI-and-CellID.rar_IMEI_ME_cellid_cellid java

    Java ME,全称为Java Micro Edition,是Java平台的一个版本,主要应用于移动设备、嵌入式系统等资源有限的环境。这个压缩包中的内容是关于如何在Java ME平台上获取设备的IMEI(国际移动设备识别码)和Cell ID(基站...

    基于CELLID设备管理测试规范.docx

    《基于CELLID设备管理测试规范》是中国移动通信企业标准的一部分,旨在规范基于CELLID位置业务(LBS,Location-Based Services)的LSP(Location Service Platform)设备的测试流程。这份文档详细阐述了测试的各项...

    CELLID_Android

    在移动通信领域,CELLID(Cell Identifier)是用于标识手机基站的一个重要参数,它与位置区(Location Area)和小区(Cell Site)的概念密切相关。在Android操作系统中,开发者可以通过特定的技术手段来抓取和分析...

    j2me获取基站信息

    ### j2me获取基站信息 在移动通信领域中,基站信息是进行位置服务的重要依据之一。J2ME(Java 2 Micro Edition)作为一款适用于移动设备的开发平台,在早期的移动应用开发中占据了一席之地。本文将详细介绍如何在...

    获取cellID

    在移动通信领域,获取Cell ID是一项重要的技术,它与网络定位息息相关。Cell ID,全称为Cell Identity,是基站(Base Station)或者小区(Cell)的一个唯一标识,用于区分不同的无线覆盖区域。在AGPS(Assisted ...

    Linux平台下从基站信息获取地图地址

    ./getlocal.sh --mcc={MCC} --mnc={MNC} --lac={LAC} --cid={CELLID} --radio=|wcdma> --flac={FROM} --tlac={TO} --fcid={FROM} --tcid={TO} Options: --flac: scan the LAC and start from the specified ...

    获取移动基站LAC CELLID 以及基站经纬度,国家,省会,城市,详细地址代码

    在移动通信领域,基站(Base Station,简称BS)是无线通信网络的重要组成部分,负责与移动设备进行无线连接。为了实现精确的位置服务,如GPS定位、紧急呼叫定位等,我们需要获取基站的相关信息,其中包括逻辑接入...

    mobile GPS 基站定位 cell id算法

    移动设备上的GPS基站定位是利用手机接收多个移动通信基站发出的信号来确定设备位置的一种技术。这种方法结合了全球定位系统(GPS)与蜂窝网络的数据,特别是在GPS信号弱或者不可用的情况下,如室内环境,基站定位能...

    CelliD:从单细胞RNA-seq的单个细胞水平提取基因标记并进行细胞身份识别

    CelliD v0.99 R包,用于从单细胞RNA-seq的单个细胞水平提取基因签名和细胞身份。 欢迎来到在BioRxiv预印本展示的CelliD软件的官方Github存储库 概述 CelliD是一种强大的统计方法,可对单细胞RNA-seq数据集中的每...

    基于CELLID位置业务(LBS)的LSP设备测试规范.docx

    【基于CELLID位置业务(LBS)的LSP设备测试规范】 本文档详细阐述了基于CELLID位置业务(Location-Based Service, LBS)的Logical Service Provider (LSP)设备的测试规范,旨在确保这些设备在提供基于网络CELL-ID...

    NiceTrack_source_1_6.zip_LAC_LAC CellId_nicetracke_wince printer

    【标题】"NiceTrack_source_1_6.zip" 是一个包含C#源代码的压缩包,主要用于实现获取手机在移动网络中的位置信息,具体来说是CellID(小区ID)和LAC(位置区码)。这类功能常用于定位服务,通过手机连接到的基站信息...

    数据查询与修改实验

    - SQL语句示例:`SELECT Cell.CellID, Cell.BtsName FROM Cell, Antenna WHERE Cell.CellID = Antenna.CellID AND Pt > 4;` - 解析:通过连接Cell表和Antenna表,查找天线发射功率大于4dbm的小区ID及其所属基站...

    CellID EVC源码

    【CellID EVC源码】是一款专用于获取基站信息的软件源码,它基于EVC(Embedded Visual C++)开发,允许用户通过AT命令与移动设备进行通信,从而获取到手机当前连接的基站识别信息,如Cell ID和LAC(Location Area ...

    Java实现Google的S2算法工具类Google S2Google S2Google S2

    * 可以用于区域内目标检索,根据cellid建立索引,查询区域内cellid in (list)的区域 S2计算点距离 计算地球上某个点是否在矩形区域内 计算点s2是否在圆中心为s1半径为capHeight的圆形区域内 判断点是否在任意形状内...

    基于CELLID 的位置业务(LBS)技术要求 Location Based Service General Technology Specification

    ### 基于CELLID 的位置业务(LBS)技术要求 #### 一、概述 本文档详述了基于CELLID的位置业务(Location Based Service, LBS)的技术要求和技术规格,旨在为中国移动通信集团公司及其下属各省份公司的LBS业务提供...

    移动LTE网络TAI、ENODEBID、CELLID编号原则.pdf

    "移动LTE网络TAI、ENODEBID、CELLID编号原则.pdf" 移动LTE网络中的跟踪区(TA)、ENODEBID、CELLID编号原则是LTE网络中的基本概念。这些概念都是LTE网络中用户位置管理和小区标识的基础。 首先,我们来了解跟踪区...

    在ASP.Net中通过cell-id和LAC获取位置信息

    return $"{{\"cellId\": {cellId}, \"locationAreaCode\": {lac}}}"; } ``` 在上面的代码中,`GetLocationAsync`方法接收cell-id和LAC,构造请求内容,并使用HttpClient发送POST请求到Google Geolocation API。...

    IMEI.rar_IMEI_基站

    IMEI(International Mobile Equipment Identity,国际移动设备身份码)是全球唯一的移动设备识别码,用于标识每一部手机。它由15位数字组成,通常在手机的包装盒、电池下面或者通过拨号*#06#可以查看到。IMEI码的...

    IT人员面试试题

    - **SQL语句**:`INSERT INTO REPORTTOTAL (REPID, REPNAME, REPDATE, ORGID, CELLID, TOTAL_VALUE) SELECT REPID, REPNAME, REPDATE, (SELECT ORGID FROM ORG WHERE ORGNAME = '国有商业银行'), '1A', SUM(VALUE) ...

Global site tag (gtag.js) - Google Analytics