Is there an Cocoa or Objective C api for Java?
صفحه اصلي

Is there an Cocoa or Objective C api for Java?

I'm a Java programmer and i wanted to get into writing so apps for the Iphone. I started to research and found myself looking at xmlvm..that all good, but then xmlvm has a with some UIWindow classes that i can't find and can't compile. Short of it is where is the api for Java so i can compile xmlvm's for the Iphone. Here's the code: and i've already compiled xmlvm with ant and have xmlvm.jar in my classpath so??

import org.xmlvm.iphone.*;  public class HelloWorld extends UIApplication {      public void applicationDidFinishLaunching(UIApplication app) {         UIScreen screen = UIScreen.mainScreen();         CGRect rect = screen.applicationFrame();         UIWindow window = new UIWindow(rect);          rect.origin.x = rect.origin.y = 0;         UIView mainView = new UIView(rect);         window.addSubview(mainView);          UILabel title = new UILabel(rect);         title.setText("Hello World!");         title.setTextAlignment(UITextAlignment.UITextAlignmentCenter);         mainView.addSubview(title);          window.makeKeyAndVisible();     }      public static void main(String[] args) {         UIApplication.main(args, HelloWorld.class);     }  } 

Do you tag your UIViews or retain them as properties?


return value javascript UIWebView
There is no java VM on the iphone - xmlvm need cross-compile the java code into an executable for the phone.. Web image display in iPhone app edit 1: this said coming from Java, you may not find objective-C this enough of a shock to migrate to. Does jquery work on the iphone´s safari?It took me a few months to learn it coming from Java and C/C++ - most of the books around iphone programming (e.g. Using a struct with OCMock or Hamcrestthe pragmatic programmer's one) also commit a little background on the language to receive you started. How to build Apple's GCC on Linux/Windows?It is a learning curve although ultimately I suspect a lot less frustrating as it the first-class language on the phone and well supported by tools and documentation etc.. Is if (variable) the same as if (variable != nil) in Objective-C edit 2: From a glance at the webpage, it looks like what xmlvm produces is actually objective-C, linked against a native xvmlm support framework. AES interoperability between .Net and iPhone?I assume the next step is to compile the objective-C output using whatever toolchain you have - probably xcode although if not then any gcc toolchain. Anyway the end result is going to be a native executable not java bytecode. You'll install this just like any executable you build from objective-C..


Looks like this question was posted 5 months ago, so it might be too late - although I imported this file into NetBeans and then added the xmlvm.jar to my library path - soon to see this .
CGRect rect = screen.applicationFrame(); 
Were broken. Thankfully, NetBeans' auto-complete told me to change the first to .
CGRect rect = screen.receive ApplicationFrame(); 
and the second to:.
I then proceeded to compile the NetBeans project without error. xmlvm compiled my resulting byte-code (.class files) to an iPhone/XCode app although then I could not receive THAT to compile for the reason this of inconsistencies in the automatically generated code.. XMLVM looks like a great project which is very promising, although as they keep updating their code, their documentation's falling behind resulting in the first mishap.. I have no logical explanation to the second..


I know this isn't exactly what you asked, although you might have a look at the GWT. It makes your app web based (which keeps it out of the store, and therefore most people aren't interested for the reason this they can't make this sweet iStore cash) although it allows you to program for web clients in a very natural java language--you must avoid dealing with "Web" protocols altoreceive her if you so choose..

58 out of 100 based on 18 user ratings 138 reviews