首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

iSpectrum-用Java编纂iPhone程序 1

2012-09-08 
iSpectrum-用Java编写iPhone程序 1今天偶然在网上看到一个宣称可以用java编写iPhone程序的eclipse插件,号

iSpectrum-用Java编写iPhone程序 1

今天偶然在网上看到一个宣称可以用java编写iPhone程序的eclipse插件,号称可以用java在非mac os上开发iPhone,相当感兴趣,于是按图索骥:

1 打开http://www.flexycore.com/en/products/ispectrum.html

iSpectrum-用Java编纂iPhone程序 1

2 选择try it now,似乎是只提供试用版的,需要注册帐号并激活,登陆后可以获得试用的license

注意:一个license只能下载一次,所以我在mac上面就不得不再次注册一个帐号。

3 开始安装,打开eclipse的software updates,我的myceclipse6.5居然不认,提示需要eclipse3.4或以上,所以搞个eclipse吧。选择new site,填写http://eclipse.flexycore.com/update/开始安装

4 填写license,否则你下载了demo也会有错误,上一步下载的plugin似乎不包含jar包,需要填写license后才开始下载。

?

6 按照reference的说法,似乎可以跑了

Select the sample code project, and then compile it for iPhone by clicking the iconiSpectrum-用Java编纂iPhone程序 1 in the icon bar:

上面这个按钮找了我半天,反正在Java EE面板上是没有的,必须打开Debug面板才看到,一按就会提示必须在mac os上,并且安装iPhone SDK才能运行

iSpectrum-用Java编纂iPhone程序 1

?

Note: If you do not runiSpectrum on a Mac OS X or you do not have the Apple iPhone SDKinstalled on your system, iSpectrum does not launch the iPhonesimulator, but Objective-C source files are generated in a folder'build' inside the Java project, and resources are copied in a folder'res' beside. You could import these files inside an iPhone Xcodeproject to compile and run your application.

?

?

?? ?上面是官方的提示信息,似乎是在非mac系统上面按运行虽然不能直接打开模拟器,但是可以在build子目录下生成xcode的代码,很可惜在windows版的eclipse3.4上,除了上面的提示,我确认确实没有生成xcode的代码。

?? ?后来上了它的forum,看到如下的文字:

I just downloaded and installed the Samples and iSpectrum under Windows.In the Documentation it is mentioned that you need iPhone SDK if you want to build binaries or launch the Simulator.In the other case it sais that it is possible to generate Objective-C code that can later be used in XCode.Hwever, I cannot find any option in the Project Settings->Flexycore section. Am I missing something or is this feature simply disabled on the trial version?best regardsMartin//*********************************************************To compile with iSpectrum you need to use a mac with the iPhone SDK installed. You cannot compile under windows.Unfortunately you also cannot generate Objective-C files since a binary iPhone App is directly generated.Best regards,Beno?t LamarcheFlexyCore Developer//*********************************************************We apologize but the website is not up-to-date. The objective-C source file generation is an old behavior. The current behavior is to generate a binary iPhone App. A new website is in the works.Sorry again for the misunderstanding.Best regards,Beno?t LamarcheFlexyCore Developer
?? ? 显然作者“曾经”可以在windows下转换为xcode代码,现在不行了,不过这样有什么用呢,没有mac的xcode也无法调试和发布。

?? ?从上面的介绍可以看出iSpectrum其实不是在iPhone上安装java虚拟机(这个似乎有其他项目做到了),而是可以把特丁的java项目转化为xcode项目,即使能够做到如此也是相当不错的,就是不知能做到什么程度:

1 可以支持java中的哪些包,或者完成哪些功能

2 有没有使用非公开api。

3 缺乏nib,界面能设计成什么样很值得怀疑。

?? ?正在测试mac版eclipse是否可以运行它的demo。

热点排行