Nokia S60錯誤查詢 For J2ME Developer

來源:互聯網
上載者:User
 

Nokia S60 錯誤查詢 For J2ME Developer * 錯誤:     遊戲運行了比較長一段時間後,無法繪製圖片或者拋出OutOfMemoryError,遊戲崩潰。 * 可能的原因:Nokia S60對J2ME的記憶體回收支援不行,它的drawRegion()(MIDP2.0)方法,產生的圖片不會被很好的回收,會不停的消耗記憶體,導致記憶體溢出,遊戲崩潰。  *********************  * 錯誤:遊戲運行速度異常的慢 * 可能的原因過於頻繁的使用System.gc(),例如,每個迴圈調用一次(這樣會導致機器很慢)。System.gc()會嚴重影響程式的運行效率,慎用。  **********************  * 和標準J2ME SDK 不同S60 的sdk不支援String.equalsIgnoreCase()方法。 --------------------------項目設定已儲存正在產生 "S60Test"G:/WTK22/apps/S60Test/src/S60Test.java:23: cannot resolve symbolsymbol : method equalsIgnoreCase (java.lang.String)location: class java.lang.String    if( s1.equalsIgnoreCase(s2) ){          ^1 errorcom.sun.kvem.ktools.ExecutionException產生失敗------------------------  ********************** * 錯誤:播放的聲音被截短了。只有音樂的一部分在迴圈播放。 * 可能的原因S60手機利用回調實現media.Player,在別的線程中頻繁的開關聲音,使得Player.start()重新開始的地方被設在音樂中的某個地方,前面的部分“泄漏”了。 有問題的代碼:public void playerUpdate( Player player, String event, Object eventData ){    if( event == PlayerListener.END_OF_MEDIA ){        if( player == bgmPlayer ){            try{                player.start();            }catch(Exception e){}        }    }}調整後的代碼:public void playerUpdate( Player player, String event, Object eventData ){    if( event == PlayerListener.END_OF_MEDIA ){        if( player == bgmPlayer ){            try{                player.setMediaTime(0);  // 複位 start() 開始標誌                 player.start();            }catch(Exception e){}        }    }}  ********************** * 錯誤[Loaded com/ltt/gknight/Gknight][Loaded com/ltt/gknight/GknightCanvas] java.lang.Error: Static initializer: java.lang.NullPointerException, null - java.lang.Class.throwError(), bci=57 - java.lang.Class.initialize(), bci=221 - java.lang.Class.forName(), bci=0  - com.symbian.midp.runtime.MIDletExecutor$MIDletConstructorThread.run(), bci=43Uncaught exception: java.lang.RuntimeException: java.lang.Error: Static initializer: java.lang.NullPointerException, null  - com.symbian.midp.runtime.MIDletExecutor$MIDletConstructorThread.run(), bci=183 * 可能的原因 在MIDlet定義static的Form對象的同時執行個體化對象,例如, public class Gknight extends MIDlet {    public static Display display = null;    public static GknightCanvas canvas = null;        public Form frm = new Form("P");        public Gknight(){        display = Display.getDisplay(this);        canvas = new GknightCanvas(this,display);    }     protected void startApp() throws MIDletStateChangeException {        if( canvas != null ){            display.setCurrent(canvas);        }    }     protected void pauseApp() {    }     protected void destroyApp(boolean arg0) throws MIDletStateChangeException {    }}   

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.