如何在三星手机上安装 Java ME 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12550568/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 09:20:11  来源:igfitidea点击:

How to install a Java ME app on Samsung phone?

javamobiledeploymentjava-mesamsung-mobile

提问by Click Upvote

My phone is supposed to be able to run: JavaTM: MIDP 2.0, CLDC 1.1 based apps. However, no matter which app I try to install on it, I get the error: Downloaded JAR are invalid

我的手机应该能够运行:JavaTM:MIDP 2.0,基于 CLDC 1.1 的应用程序。但是,无论我尝试在其上安装哪个应用程序,都会收到错误消息:Downloaded JAR are invalid

I've tried to build Java ME projects on Netbeans, using MIDP 2.0 and CLDC 1.1 as specified. The apps are simple, using the auto generated code that comes with Netbeans, to display a hello world message. It works in the emulator however when I transfer the .JAR to the mobile, I get the above error.

我尝试使用指定的 MIDP 2.0 和 CLDC 1.1 在 Netbeans 上构建 Java ME 项目。这些应用程序很简单,使用 Netbeans 附带的自动生成代码来显示 hello world 消息。它在模拟器中工作,但是当我将 .JAR 传输到移动设备时,出现上述错误。

Thisis the model and specifications of the phone.

是手机的型号和规格。

Does anyone who developed any Java ME apps for this or any similar Samsung phones, have any idea of what I need to do?

有没有人为此或任何类似的三星手机开发过任何 Java ME 应用程序,知道我需要做什么吗?

Edit: Contents of jad file:

编辑:jad 文件的内容:

MIDlet-1: Midlet, , hello.Midlet
MIDlet-Jar-Size: 1565
MIDlet-Jar-URL: MobileApplication1.jar
MIDlet-Name: MobileApplication1
MIDlet-Vendor: Vendor
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0

回答by michael aubert

Although many phones allow additional methods of installing MIDlets, the only standard way that they are all supposed to support according to the JavaME specifications is:

尽管许多手机允许安装 MIDlet 的其他方法,但根据 JavaME 规范,它们都应该支持的唯一标准方法是:

  • put the jad and the jar on a web server somewhere anybody can access them. choose a server that your mobile network operator doesn't block.

  • open the phone web browser. make it go to the jad file URL.

  • the web browser should download the jad file, realize what it is, make the phone install the application.

  • the internet connection of the phone should be using the cellular network at the time of install (no wi-fi...)

  • 将 jad 和 jar 放在任何人都可以访问的网络服务器上。选择您的移动网络运营商不会阻止的服务器。

  • 打开手机网络浏览器。让它转到 jad 文件 URL。

  • 网络浏览器应该下载jad文件,了解它是什么,让手机安装应用程序。

  • 安装时手机的互联网连接应使用蜂窝网络(无 wi-fi...)

回答by Telmo Pimentel Mota

Maybe your filename is too big. "MobileApplication1" has 18 characters. Try to reduce both names (jad and jar) to equal or below 13, for example: MobileApp.jad and MobileApp.jar
Place both files at SD Card and open Jad file.

也许你的文件名太大了。“MobileApplication1”有 18 个字符。尝试将两个名称(jad 和 jar)减少到等于或小于 13,例如:MobileApp.jad 和 MobileApp.jar
将两个文件放在 SD 卡上并打开 Jad 文件。