最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

J2me MIDlet操作手机功能性用法总结

来源:动视网 责编:小OO 时间:2025-09-24 10:29:02
文档

J2me MIDlet操作手机功能性用法总结

J2meMIDlet操作手机功能性用法总结(如调用其他程序或者调用其他MIDlet)分类:j2me/wm/andriod/移动开发2010-07-1411:01957人阅读评论(3)收藏举报本技术文章,由www.j2megame.com原创,转载请说明。 方法1:MIDlet通过platformRequest,调用手机本地应用程序。 示例:S60中调用platformRequest("nativeapp:application-exe=MediaPlayer.exe;content=E:/Fe
推荐度:
导读J2meMIDlet操作手机功能性用法总结(如调用其他程序或者调用其他MIDlet)分类:j2me/wm/andriod/移动开发2010-07-1411:01957人阅读评论(3)收藏举报本技术文章,由www.j2megame.com原创,转载请说明。 方法1:MIDlet通过platformRequest,调用手机本地应用程序。 示例:S60中调用platformRequest("nativeapp:application-exe=MediaPlayer.exe;content=E:/Fe
J2me MIDlet操作手机功能性用法总结(如调用其他程序或者调用其他MIDlet) 

分类: j2me/wm/andriod/移动开发 2010-07-14 11:01 957人阅读 评论(3) 收藏 举报 

本技术文章,由www.j2megame.com原创, 转载请说明。

 

方法1:MIDlet 通过 platformRequest,调用手机本地应用程序。

 示例:

S60中调用

platformRequest("nativeapp:application-exe=MediaPlayer.exe;content=E:/Feelings.MP3;application-args=-ExampleArgument");

S40中调用

platformRequest("localapp://gallery/show?folder=C:/predefgallery/predefphotos"); 

 

 

方法2:MIDlet通过 platformRequest,调用其他MIDlet。

示例:

S40中

platformRequest("localapp://jam/launch?midlet-name=ArcadeGames;midlet-vendor=Acme;sounds=OFF;difficulty=easy;wizard_mode=ON"); 

MIDlet启动参数说明

Nokia-MIDlet-Launch-Params: sounds,difficulty,wizard_mode

The ArcadeGames MIDlet can access the parameters as follows: 

System.getProperty("sounds");

System.getProperty("difficulty");

System.getProperty("wizard_mode"); 

platformRequest("javaapp:midlet-name=ArcadeGames;midlet-vendor=Acme;sounds=OFF;difficulty=easy;wizard_mode=ON");

通过MIDlet的UID启动

 

platformRequest("javaapp:midlet-uid=0xE1000000;sounds=OFF;difficulty=easy;wizard_mode=ON);

 

 

 

方法3:手机本地应用程序调用MIDlet

代码如下:

The following example code shows how to launch a MIDlet from a native Symbian application.

    RProcess rProcess;

    TInt err = rProcess.Create(_L("javalauncher.exe"), _L("midlet-uid=0x10137c4d;startMode=startFromCmdLine;sound=ON;landscapeMode=true;"));

    if (KErrNone == err)

    {

        TRequestStatus status;

        rProcess.Logon(status);

        rProcess.Resume();

        // now wait until javalauncher exits

        User::WaitForRequest(status);

        if (status.Int() != KErrNone)

        {

            // Launching midlet failed

            err = status.Int();

        }

    }

    else

    {        

        // Cannot start javalauncher

    }

    rProcess.Close();

The following example code shows how to launch the same MIDlet from a Symbian application using Open C APIs. 

include

gint exitStatus = 0;

// Start javalauncher and wait until it starts midlet

gboolean startOK = g_spawn_command_line_sync(

         "javalauncher midlet-uid=0x10137c4d;startMode=startFromCmdLine;sound=ON;landscapeMode=true;

        NULL,

        NULL,

        &exitStatus,

        NULL);

if (startOK)

{

    if (exitStatus != 0)

    {

        // launching midlet failed, (Symbian) error code in exitStatus

    }

}

else

{

    // Cannot start javalauncher

}

 

 

方法4:MIDlet重新启动

In Series 40 and Symbian, when a MIDlet is already running and it is re-launched, it is set on the foreground and can receive the new command line parameters.

In Symbian, every time a MIDlet is re-launched, the integer value in com.nokia.mid.cmdline.instance system property is incremented by one. This value can be used to check whether the MIDlet has really been re-launched or just brought to the foreground. The old values of the command line arguments are not changed unless new command line values redefine them. If JAD attribute Nokia-MIDlet-Background-Event has the value pause, the startApp method is called every time the MIDlet is brought to foreground. This provides an easy way to acquire new command line parameters.

 

方法5:从手机浏览器网站链接启动MIDlet

n Symbian, when a link with the javaapp: or localapp://jam/launch? URI scheme is opened on a web page, the corresponding MIDlet is launched. If JavaScript is enabled, a JavaScript function may also activate the link.

Before the MIDlet is started from a web browser link, the auto invocation permission of the MIDlet is checked. This means that in case of third-party MIDlets, the user is always asked at least once to confirm the MIDlet launch.

If you use non-US-ASCII characters in the URL, you must use UTF-8 encoding. Also spaces must be encoded, for example: 

javaapp:midlet-name=Arcade Pro;midlet-vendor=Acme;midlet-n=1;sounds=OFF;difficulty=medium

 

方法6:MIDlet platformRequest其他常用功能

打电话: 

platformRequest("tel:+19143680400"); 

打开网页:

platformRequest("http://www.forum.nokia.com/"); 

打开1个RTSP流连接: 

platformRequest("rtsp://ra.yle.fi/ramgen/tv2/viihde/zencafe.rm"); 

利用本地默认软件打开1个本地文件

打开短信编辑器,并发短信到指定号码

platformRequest("sms:+19143680400"); 

 

 

其他常用列表及功能:

使用连接后提示用语列表

Table: Supported URI schemes:

URI schemeSupported in SymbianSupported in Series 40Java user confirmation promptBehavior
http:YesYes"Allow this application to use network for sending/receiving data?" Open URI in Browser 
https:YesYes"Allow this application to use network for sending/receiving data?" Open URI in Browser 
rtsp:YesProduct dependentNo user prompt RealPlayer starts, asks 'Connection to server needed. Connect?' Y/N 
file:YesNo"Allow this application start an application?" Open file in MIME type specific application 
mailto:YesProduct dependentNo user prompt Open E-mail or MMS editor 
wtai:YesNo"Allow this application start an application?" Like tel: / open address book for edit / send DTMF sequence 
mms:YesNoNo user prompt RealPlayer starts, asks 'Connection to server needed. Connect?' Y/N 
cti:YesNoNo user prompt Computer telephony integration. Like tel: 
mmsto:YesNoNo user prompt Open MMS editor 
sms:YesNoNo user prompt Open SMS editor 
localapp:YesYes"Allow this application start an application?" Start local application In Series 40, only allowed for manufacturer and operator MIDlets. In Symbian Java all domains work but only some applications are supported. See following table.

javaapp:Yes No"Allow this application start an application?" Start Java application 

For more information, see Launching a MIDlet from another MIDlet.

nativeapp:YesNoNo user prompt Start native application. Only allowed for manufacturer and operator MIDlets. 

For more information, see Launching a native application from a MIDlet.

tel:YesYesNo user prompt Asks confirmation before making phone call 
Added protocolsYesNo"Allow this application start an application?"  
In Symbian, localapp supports launching only the following applications:

Symbian本地应用程序列表

Table: Localapp usage in Symbian

ApplicationAccepted arguments
Contacts localapp://contacs
Calendar localapp://calendar/Today

localapp://calendar

Messaginglocalapp://messaging

文档

J2me MIDlet操作手机功能性用法总结

J2meMIDlet操作手机功能性用法总结(如调用其他程序或者调用其他MIDlet)分类:j2me/wm/andriod/移动开发2010-07-1411:01957人阅读评论(3)收藏举报本技术文章,由www.j2megame.com原创,转载请说明。 方法1:MIDlet通过platformRequest,调用手机本地应用程序。 示例:S60中调用platformRequest("nativeapp:application-exe=MediaPlayer.exe;content=E:/Fe
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top