2012-02-22 2 views
0

は、クロスデバイスJavaMEのに支持を与え、すべてのモバイルメーカー-workingする必要がデバイス。JavaMeを使用してデフォルトのブラウザでリンクを開く方法は?アプリケーションが開いているとき、それはモバイルのデフォルトブラウザに(ケーブル接続)リンクにリダイレクト:特に</p> <p>から

ないモバイルのJavaアプリでそれを行う方法を見つけましたが、JavaMEののための例を発見していません。

私はSun Java Wireless Tool Kit 2.5.2とeclipseMEを使用してJavaMEを使用しています。

EDIT: は私がやろうとしている:

 try { 
     platformRequest("http://www.stackoverflow.com"); 
     destroyApp(true); 
     notifyDestroyed(); 
    } catch (ConnectionNotFoundException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 

しかし、それはすべてのプラットフォームで動作する場合はわかりません。また、なぜアプリを破壊する必要がありますか?

答えて

2

まあ、これは、コードのコメントを読んでください方法です。また

  // In startApp() 

    boolean mustExit = false; 
    try { 

     /** 
     * mustExit - Boolean 
     * 
     * Some MIDP platforms are more restricted than others. 
     * For example, some don't support concurrent processing, 
     * so the MIDlet must exit before the platform can honor 
     * a service request. 
     * 
     * If <true> destroy the app. So the browser 
     * can start. 
     */ 
     mustExit = platformRequest("http://www.stackoverflow.com"); 
    } catch (ConnectionNotFoundException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 

    if(mustExit){ 
     destroyApp(true); 
     notifyDestroyed(); 
    } 

、あなたがLinuxである場合、あなたはエミュレータのデフォルトのブラウザを設定する必要があります。今の.jadを作成し、あなたのemulator.Orでそれを実行

(もちろん、他のブラウザことができる)

# Associate the Mozilla browser with platformRequest() - Linux 
com.sun.midp.midlet.platformRequestCommand: /usr/bin/firefox 

yourPath/Java/lib/system.configに移動し、最後に、次の行を追加します。 jaあなたの物理的な電話でそれを実行します。

関連する問題