<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-60  評論-138  文章-1  trackbacks-0
    本篇是本人收集到的怎么獲取手機的Imei和cellid的總結,由于這兩個屬性是每個廠商自己實現,故而沒有統一的方法。本人收集的也不全,測試亦是不全面。放置一篇文章在這里,希望有興趣的人多多補充。

    資料來源如下:
    http://web.mit.edu/21w.780/www/spring2007/guide/
    http://wiki.forum.nokia.com/index.php/CS000947_-_Getting_Cell_ID_in_Java_ME
    http://forums.sun.com/thread.jspa?threadID=5278668
    https://developer.sonyericsson.com/message/110949

    測試代碼如下,當中使用了polish做適配:

    package study;

    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;

    import de.enough.polish.ui.Form;

    /**
     * 
     * 
    @author: zhanghongzhi lanfanss@126.com
     * 
    @version: 0.1
     * @time: 2008-8-10 下午01:56:17
     * 
     
    */
    public class GetIMEIAndCellId extends MIDlet implements CommandListener {
        
    private Command exitCommand = new Command("exit", Command.EXIT, 1);

        Form form 
    = new Form("imei and cellid");
        Display display 
    = null;

        
    public GetIMEIAndCellId() {
            display 
    = Display.getDisplay(this);

        }

        
    protected void destroyApp(boolean arg0) {

        }

        
    protected void pauseApp() {

        }

        
    protected void startApp() throws MIDletStateChangeException {
            
    //獲取系統信息
            String info = System.getProperty("microedition.platform");
            
    //獲取到imei號碼
            String imei = "";
            
    //cellid
            String cellid = "";
            
    //lac
            String lac = "";
            
    //#if polish.vendor==Sony-Ericsson
            imei = System.getProperty("com.sonyericsson.imei");
            
    //參考 http://forums.sun.com/thread.jspa?threadID=5278668
            
    //https://developer.sonyericsson.com/message/110949
            cellid = System.getProperty("com.sonyericsson.net.cellid");
            
    //獲取索愛機子的
            lac = System.getProperty("com.sonyericsson.net.lac");
            
    //#else if polish.vendor==Nokia
            imei = System.getProperty("phone.imei");
            
    if (imei == null || "".equals(imei)) {
                imei 
    = System.getProperty("com.nokia.IMEI");
            }
            
    if (imei == null || "".equals(imei)) {
                imei 
    = System.getProperty("com.nokia.mid.imei");
            }
            
    //獲取到cellid
            
    //參考http://wiki.forum.nokia.com/index.php/CS000947_-_Getting_Cell_ID_in_Java_ME
            
    //#if polish.group==Series60
            cellid = System.getProperty("com.nokia.mid.cellid");
            
    //#else if polish.group==Series40
            cellid = System.getProperty("Cell-ID");
            
    //#endif
            
    //#else if polish.vendor==Siemens
            imei = System.getProperty("com.siemens.imei");
            
    //#else if polish.vendor==Motorola
            imei = System.getProperty("com.motorola.IMEI");
            
    //cellid 參考 http://web.mit.edu/21w.780/www/spring2007/guide/
            cellid = System.getProperty("CellID");
            
    //#else if polish.vendor==Samsung
            imei = System.getProperty("com.samsung.imei");
            
    //#endif

            
    if (imei == null || "".equals(imei)) {
                imei 
    = System.getProperty("IMEI");
            }

            
    //展示出來
            form.append("platforminfo:" + info);
            form.append(
    "imei:" + imei);
            form.append(
    "cellid:" + cellid);
            form.setCommandListener(
    this);
            form.addCommand(exitCommand);
            display.setCurrent(form);
        }

        
    public void commandAction(Command cmd, Displayable item) {
            
    if (cmd == exitCommand) {
                destroyApp(
    false);
                notifyDestroyed();
            }
        }

    }

    目前我手機的測試結果如下,希望大家能夠補充測試結果或者指出文中紕漏之處:
    夏普-sh9010c:不能夠獲取
    sonyericsson:
         c702,k818c:能夠獲取imei及cellid

    posted on 2008-08-11 16:52 張氏兄弟 閱讀(4742) 評論(1)  編輯  收藏 所屬分類: 手機地圖

    評論:
    # re: 探討:通過j2me獲取手機imei號碼和cellid(基站號) 2009-03-10 22:25 | leelight
    cellid = System.getProperty("com.nokia.mid.cellid");
    cellid = System.getProperty("Cell-ID");

    nokia自己的手機都不支持,測試過s40,s60
    c702 沒問題
    還有各種手機,cellid獲取也沒個標準  回復  更多評論
      
    主站蜘蛛池模板: 国产成人高清精品免费鸭子| 高清一区二区三区免费视频| 国产精品入口麻豆免费观看| 亚洲国产成人久久综合碰碰动漫3d| 国产精品亚洲综合网站| 日韩成全视频观看免费观看高清| 国产亚洲精品VA片在线播放| 欧美大尺寸SUV免费| 香蕉大伊亚洲人在线观看| 免费人成视频在线| 亚洲精品久久无码| 国产午夜免费秋霞影院| 一道本不卡免费视频| 亚洲色欲一区二区三区在线观看| 一区二区视频免费观看| 日本红怡院亚洲红怡院最新| 美丽姑娘免费观看在线观看中文版| 久久精品7亚洲午夜a| 2021在线观看视频精品免费| 亚洲一区二区三区乱码在线欧洲| 免费鲁丝片一级观看| 精品在线视频免费| 国产亚洲综合成人91精品| 最刺激黄a大片免费网站| 午夜在线a亚洲v天堂网2019| 亚洲日韩中文在线精品第一 | 午夜免费啪视频在线观看 | 亚洲精品天堂无码中文字幕| 四虎影视精品永久免费网站| 中文字幕免费在线视频| 亚洲综合免费视频| 国产成人3p视频免费观看| 久久久久国色AV免费观看| 亚洲综合婷婷久久| 四虎免费在线观看| 久久免费国产精品| 亚洲va在线va天堂va手机| 亚洲国产综合无码一区二区二三区| 亚欧免费无码aⅴ在线观看| 亚洲伊人久久大香线蕉AV| 国产精品亚洲综合一区|