Chào mừng đến với Diễn đàn lập trình - Cộng đồng lập trình.
Kết quả 1 đến 4 của 4
  1. #1
    Ngày tham gia
    Sep 2015
    Bài viết
    0

    Lấy Cell ID trên máy Nokia 2730 classic được không???

    Tôi muốn lấy địa chỉ Cell Id trên 2730 classic , tìm hiểu trên mạng có được source:
    Mã:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
     
    public class CellIDMIDlet extends MIDlet implements CommandListener {
        private Form form;
        private Command exitCommand;
        private String S40_cell_id;   // Series 40 cell id property
        private String S60_cell_id;   // S60 cell id property
     
        public void startApp() {
            form = new Form("Getting Cell ID");
            S40_cell_id = System.getProperty("Cell-ID");
            S60_cell_id = System.getProperty("com.nokia.mid.cellid");
            form.append("Series 40 devices: " + S40_cell_id + "
    ");
            form.append("S60 devices: " + S60_cell_id);
            exitCommand = new Command("Exit", Command.EXIT, 1);
            form.setCommandListener(this);
            form.addCommand(exitCommand);
            Display.getDisplay(this).setCurrent(form);
        }
     
        public void pauseApp() {
        }
     
        public void destroyApp(boolean unconditional) {
        }
     
        public void commandAction(Command c, Displayable d) {
            if (c == exitCommand) this.notifyDestroyed();
        }
    }
    Mã:
    www.developer.nokia.com/Community/Wiki/CS000947_-_Getting_Cell_ID_in_Java_ME
    nhưng khi chạy trên 2730 classic ( nền tảng s40) thì kết quả là " null"
    Vậy làm sao bầy giờ? Làm sao lấy cell id trên 2730? Hay 2730 ko có API : System.getProperty("Cell-ID"); ???

  2. #2
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    bạn sửa lại làm startApp như sau xem nó in ra lỗi gì nhé

    Mã:
    public void startApp() {        form = new Form("Getting Cell ID");                try {            Class.forName("com.nokia.mid.cellid");            S40_cell_id = System.getProperty("Cell-ID");            S60_cell_id = System.getProperty("com.nokia.mid.cellid");            form.append("Series 40 devices: " + S40_cell_id + "
    ");            form.append("S60 devices: " + S60_cell_id);            exitCommand = new Command("Exit", Command.EXIT, 1);            form.setCommandListener(this);            form.addCommand(exitCommand);        } catch (ClassNotFoundException ex) {            form.append("[loi:" + ex.getMessage() + "]");        }         Display.getDisplay(this).setCurrent(form);    }

  3. #3
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Máy báo lỗi
    Mã:
    [loi:comokia/mid/cellid]
    Như vậy là sao hả Zstar?

    Chắc là cái con 2730 classic của mình ko lấy được Cell ID roài. buồn...

  4. #4
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    có nghĩa là class com.nokia.mid.cellid không tồn tại !

    nhìn lại đoạn code của bạn thì lỗi là đúng rùi, vì Nokia 2730 classic xài Sybian s40, bạn check cả code của S60 song song đương nhiên là lỗi.

    - vấn đề Cell-ID null có thể bạn phải mua signing từ Nokia để chứng nhận ứng dụng của bạn là strust application.

 

 

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •