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

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

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

    隨筆-60  評(píng)論-138  文章-1  trackbacks-0
    本篇是本人收集到的怎么獲取手機(jī)的Imei和cellid的總結(jié),由于這兩個(gè)屬性是每個(gè)廠商自己實(shí)現(xiàn),故而沒有統(tǒng)一的方法。本人收集的也不全,測試亦是不全面。放置一篇文章在這里,希望有興趣的人多多補(bǔ)充。

    資料來源如下:
    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

    測試代碼如下,當(dāng)中使用了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 {
            
    //獲取系統(tǒng)信息
            String info = System.getProperty("microedition.platform");
            
    //獲取到imei號(hào)碼
            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");
            
    //獲取索愛機(jī)子的
            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();
            }
        }

    }

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

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

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

    nokia自己的手機(jī)都不支持,測試過s40,s60
    c702 沒問題
    還有各種手機(jī),cellid獲取也沒個(gè)標(biāo)準(zhǔn)  回復(fù)  更多評(píng)論
      
    主站蜘蛛池模板: 在线视频免费国产成人| 亚洲精品卡2卡3卡4卡5卡区| 日韩在线视精品在亚洲| 亚洲七七久久精品中文国产| 69成人免费视频| 国产亚洲精品美女久久久久| 亚洲精品美女久久久久99| 91精品免费在线观看| 成人午夜免费视频| 亚洲蜜芽在线精品一区| 亚洲AV之男人的天堂| 51精品视频免费国产专区| 春暖花开亚洲性无区一区二区 | 中文字幕无码成人免费视频| 国产精品亚洲色图| 久久精品国产亚洲AV香蕉| yy6080久久亚洲精品| 久久精品人成免费| 一级特级女人18毛片免费视频| 亚洲国产成人久久99精品| 国产AⅤ无码专区亚洲AV| 噜噜嘿在线视频免费观看| 男女午夜24式免费视频| 色妞www精品视频免费看| 91亚洲视频在线观看| 亚洲精品无码AV人在线播放| 真实乱视频国产免费观看| 免费人成在线观看网站品爱网| 日本视频免费观看| 亚洲一线产品二线产品| 亚洲黄色三级视频| 国产成人精品日本亚洲网站| 又黄又大又爽免费视频| 香蕉97超级碰碰碰免费公| 暖暖日本免费中文字幕| 人人公开免费超级碰碰碰视频| 亚洲综合精品伊人久久| 亚洲视频一区在线| 久久亚洲私人国产精品| 亚洲AV无码乱码在线观看裸奔 | 成人免费看片又大又黄|