我们可以在 iPhone 上运行 Java 应用程序吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1193524/
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
Can we run Java applications on iPhone?
提问by SocialCircus
Can we run or develop apps for iPhone in Java?
我们可以用 Java 为 iPhone 运行或开发应用程序吗?
Have a look to these links and answer:
看看这些链接并回答:
采纳答案by gizmo
Currently, there is no JVM running on the iPhone. This means that the only way you have to develop apps for iPhone in Java is to have a compiler that will compile your java code down to Objective-C code.
目前,iPhone 上没有运行 JVM。这意味着您必须使用 Java 为 iPhone 开发应用程序的唯一方法是拥有一个编译器,它将您的 Java 代码编译为 Objective-C 代码。
There are several solutions that do exactly that:
有几种解决方案可以做到这一点:
Codename One- focuses on building applications using Java with visual tools and simulators. Open source with a SaaS backend that removes the need for a Mac.
代号一- 专注于使用 Java 和可视化工具和模拟器构建应用程序。具有 SaaS 后端的开源,无需 Mac。
XMLVM - a translator to convert Java bytecode to C/Objective-C. Open source, but requires writing iOS specific code at the moment.
XMLVM - 将 Java 字节码转换为 C/Objective-C 的翻译器。开源,但目前需要编写 iOS 特定代码。
There are also several proprietary solutions but I have no experience with them. E.g. Software AG has a tool called web objects.
还有几个专有解决方案,但我没有使用它们的经验。例如,Software AG 有一个称为 Web 对象的工具。
回答by Thomas Einwaller
I would say: No
我会说:不
If you want to create "real" native iPhone applications you will have to go with Objective C and the iPhone SDK
如果你想创建“真正的”原生 iPhone 应用程序,你将不得不使用 Objective C 和 iPhone SDK
There are other ways like http://phonegap.com/but I personally have no experience with this project.
还有其他方式,如http://phonegap.com/,但我个人没有这个项目的经验。
回答by Atmocreations
there is an implementation of a java virtual machine called "Classpath", but the drawback is that you may only get it using Cydia/Installer.
有一个名为“Classpath”的 Java 虚拟机的实现,但缺点是您只能使用 Cydia/Installer 来获取它。
Means, you need to jailbreak your iphone in order to be able to install the JVM.
意思是,你需要越狱你的 iPhone 才能安装 JVM。
the gui can be designed like an AWT-Gui.
gui 可以像 AWT-Gui 一样设计。
in general: no solution (apple does not allow applications that run other applications on their devices)
一般:无解决方案(苹果不允许应用程序在其设备上运行其他应用程序)
if you don't mind hacking the devices your application is deployed to: yes, there shouldn't be a big problem. there is a large amount of tutorials how to hack your iphone, if you're interested...
如果您不介意入侵您的应用程序部署到的设备:是的,应该没有大问题。有大量的教程如何破解你的 iphone,如果你有兴趣......
EDIT:there is a problem! If you don't have the file libuicaboodle
every Java-GUI-App for iPhone is looking for, you won't be able to run the app. Is there anybode who still has this file? Can't find it anywhere anymore :o(
编辑:有问题!如果您没有libuicaboodle
每个 Java-GUI-App for iPhone 都在寻找的文件,您将无法运行该应用程序。有没有人还有这个文件?再也找不到它了:o(
regards
问候
回答by Thorbj?rn Ravn Andersen
Sun found they could port Java to the iPhone, but the SDK license prohibits it. So this is not a technical but a political issue.
Sun 发现他们可以将 Java 移植到 iPhone,但 SDK 许可证禁止这样做。所以这不是技术问题,而是问题。
回答by fg.
Webapp can be developed in Java of course, but you're not allowed to run Java applications ON the Iphone (VMs are not authorized on the device).
Webapp当然可以用Java开发,但你不能在Iphone上运行Java应用程序(虚拟机在设备上没有授权)。
There is some effort in Java to objective-c conversion, as with XMLVM(check the Google TechTalk video).
在 Java 中有一些目标-c 转换,就像XMLVM 一样(查看 Google TechTalk 视频)。
回答by SocialCircus
At the end what I can conclude is that one can develop iPhone web apps easily with Java. For developing native apps for iPhone in Java one may use alcheMoor XMLVMwith a little working.I have no experience in alcheMoor XMLVMbut surely looking forward to it.
最后我可以得出的结论是,可以使用 Java 轻松开发 iPhone 网络应用程序。对于开发iPhone本机应用程序在Java中一个可以使用alcheMo或XMLVM一点点working.I有没有经验alcheMo或XMLVM但肯定期待着它。
Thank You All.
谢谢你们。
回答by faisal
there is several ways to write an iphone application on java by using xmlvm converter to objective c but is hard but it is the suitable and the compatible way to do ur application u need to learn xml language
有几种方法可以通过使用 xmlvm 转换器到目标 c 在 java 上编写 iphone 应用程序,但很难,但它是做你的应用程序的合适和兼容的方式,你需要学习 xml 语言
回答by urish
An interesting approach is combining the Google Web Toolkit with Appcelerator Titanium for developing iPhone applications using Java.
一个有趣的方法是将 Google Web Toolkit 与 Appcelerator Titanium 结合起来使用 Java 开发 iPhone 应用程序。
Google Web Toolkit (GWT) allows compilation of Java code into Javascript, while Titanium allows creation of native-looking iPhone applications in Javascript. I have started a project called "gwt-titanium" to combine the two, you can find an explanation about the project and building instructions on the blog at iPhoneJava.org.
Google Web Toolkit (GWT) 允许将 Java 代码编译为 Javascript,而 Titanium 允许在 Javascript 中创建外观原生的 iPhone 应用程序。我已经启动了一个名为“ gwt-titanium”的项目来将两者结合起来,您可以在iPhoneJava.org的博客上找到有关该项目的解释和构建说明。
Good luck!
祝你好运!