This discussion is archived
1 7 8 9 10 11 13 Previous Next 182 Replies Latest reply: Jan 4, 2013 5:40 AM by rukbat Go to original post RSS
  • 120. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    RichardBair Journeyer
    Currently Being Moderated
    In the meantime we could discuss the main technical challenges to bring Java(FX) to Android, iOS and Windows 8:

    1. Porting JavaFX glass/prims to iOS (OpenGL ES2), Android (???) and Windows 8 (DirectX???)
    You actually will end up wanting to use OpenGL ES2 on both iOS and Android (having done the comparisons, the Prism stack on ES2 on Android is as fast or faster than native android graphics). On Windows 8, you use Direct3D the same as on Windows desktop, but you have to use WinRT instead of Win32 for the windowing etc. So there is definitely porting work on the Glass/Prism layer for Windows.
    2. Bundle Java/OpenJDK within the app so that it's only one binary (static linking, no dynamic library loading!) (keywords: AOT (ahead of time compiler), Java-to-native-compiler, OpenJDK zero, shark, JNI, ...)
    This is actually the biggest challenge IMO (in fact there is a thread on OpenJDK about porting OpenJDK to Android). I don't know off the top of my head if the JavaSE Embedded VM is open source -- I thought it was, or it was planned to make it so, but I could be wrong. In any case, getting a VM that runs on the platform is easy enough, getting JavaSE class libraries which pass the TCK is where I expect the majority of the work to be (porting FX to those platforms is fairly straightforward and with all the performance work we've already done in 8, you're starting from a pretty good place in terms of performance).

    There are some interesting VM options you could give a try, such as Excelsior Jet or even XMLVM or LLVM. You might want to give a look to XMLVM, its kind of wild. You don't need AOT on Android, but you will on WinRT & iOS.
    3. Shrinking JDK to a minimum (10MB instead of 140MB)
    Actually you don't care about the JDK, but the JRE. Now, we've got the JRE + JavaFX down to about 20MB I think, but if you use an aftermarket tool like ProGuard then you can strip out methods and such you don't use, not just classes. FossilGame for iOS was down to 18MB for the entire app, 20MB with retina splash screen using this technique. One big part of this is getting the SE Embedded VM (or some other VM) which is small, even with AOT. That, I suspect, will be a technical challenge.
    4. native look and feel (skin, css, ...) and native looking components (e.g. date chooser on iOS, lists, tab bar, navigation, ...)
    This is dead easy and can all be done via CSS. See the blog post on FX Experience where Jasper does skinning of buttons, and includes some Windows / iOS buttons. Also, the JavaOne scheduler app (which is open source in the OpenJFX 8 repos) we did an entire popover control with skinning etc so it looks like native iOS popovers.
    5. access to native features (like Phonegap/Cordova do it) like camera capture, geolocation, music library access on tablets, ...)
    Ya, right now just use JNI. We played with something more like the underlying mechanism that Eclipse uses which generates Java classes to call into various APIs but doesn't have hardly any native code, but it isn't released anywhere. Some APIs would be worth having a cross platform implementation, but honestly for most of these things, you want to have every single capability of the host platform available so that you can get really good, deep, native integration. So I would expect to have an iOS package with camera, geolocation, etc APIs available, and an Android package with their APIs, etc. Then maybe a generic package with the least-common-denominator. I don't know, haven't looked at the specifics.

    Also, you're going to want to be able to embed native controls inside FX to be able to do things like host advertisements in the application. That will require some work on Glass / Prism when it is open sourced.

    Richard
  • 121. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    875756 Pro
    Currently Being Moderated
    in fact there is a thread on OpenJDK about porting OpenJDK to Android
    I guess this: http://thread.gmane.org/gmane.comp.java.openjdk.general/3072
    I don't know off the top of my head if the JavaSE Embedded VM is open source
    I'm assuming you mean the "embedded JRE profile" work being done by the Embedded team. If so then from what I can work out their code is all against this forest: http://hg.openjdk.java.net/jdk8/profiles/ and the intent is for it to be part of the core JRE.

    See http://mail.openjdk.java.net/pipermail/build-infra-dev/2012-November/002338.html


    I've only got a superficial understanding of the rest of Richard's comments.

    If someone wants to take point on this and basically work out the direction to take this and the tasks that need doing, then I am willing to look at those tasks and do whatever one's I can. I've got neither the background in this sort of stuff nor the time to take lead on it though.

    I do think points 1 - 3 are the focus. Points 4 and 5 are easily added once the core platform is working in my opinion and a secondary concern (though they do look a lot more fun than 1 - 3). For me the goal would be to get a Hello World going on an Android phone using JFX - no bells and whistles.

    I guess the JFX bit can't be done till they finish open sourcing it, but could we start work on the JRE part of it at all?



    Richard Bair wrote:
    In the meantime we could discuss the main technical challenges to bring Java(FX) to Android, iOS and Windows 8:

    1. Porting JavaFX glass/prims to iOS (OpenGL ES2), Android (???) and Windows 8 (DirectX???)
    You actually will end up wanting to use OpenGL ES2 on both iOS and Android (having done the comparisons, the Prism stack on ES2 on Android is as fast or faster than native android graphics). On Windows 8, you use Direct3D the same as on Windows desktop, but you have to use WinRT instead of Win32 for the windowing etc. So there is definitely porting work on the Glass/Prism layer for Windows.
    2. Bundle Java/OpenJDK within the app so that it's only one binary (static linking, no dynamic library loading!) (keywords: AOT (ahead of time compiler), Java-to-native-compiler, OpenJDK zero, shark, JNI, ...)
    This is actually the biggest challenge IMO (in fact there is a thread on OpenJDK about porting OpenJDK to Android). I don't know off the top of my head if the JavaSE Embedded VM is open source -- I thought it was, or it was planned to make it so, but I could be wrong. In any case, getting a VM that runs on the platform is easy enough, getting JavaSE class libraries which pass the TCK is where I expect the majority of the work to be (porting FX to those platforms is fairly straightforward and with all the performance work we've already done in 8, you're starting from a pretty good place in terms of performance).

    There are some interesting VM options you could give a try, such as Excelsior Jet or even XMLVM or LLVM. You might want to give a look to XMLVM, its kind of wild. You don't need AOT on Android, but you will on WinRT & iOS.
    3. Shrinking JDK to a minimum (10MB instead of 140MB)
    Actually you don't care about the JDK, but the JRE. Now, we've got the JRE + JavaFX down to about 20MB I think, but if you use an aftermarket tool like ProGuard then you can strip out methods and such you don't use, not just classes. FossilGame for iOS was down to 18MB for the entire app, 20MB with retina splash screen using this technique. One big part of this is getting the SE Embedded VM (or some other VM) which is small, even with AOT. That, I suspect, will be a technical challenge.
    4. native look and feel (skin, css, ...) and native looking components (e.g. date chooser on iOS, lists, tab bar, navigation, ...)
    This is dead easy and can all be done via CSS. See the blog post on FX Experience where Jasper does skinning of buttons, and includes some Windows / iOS buttons. Also, the JavaOne scheduler app (which is open source in the OpenJFX 8 repos) we did an entire popover control with skinning etc so it looks like native iOS popovers.
    5. access to native features (like Phonegap/Cordova do it) like camera capture, geolocation, music library access on tablets, ...)
    Ya, right now just use JNI. We played with something more like the underlying mechanism that Eclipse uses which generates Java classes to call into various APIs but doesn't have hardly any native code, but it isn't released anywhere. Some APIs would be worth having a cross platform implementation, but honestly for most of these things, you want to have every single capability of the host platform available so that you can get really good, deep, native integration. So I would expect to have an iOS package with camera, geolocation, etc APIs available, and an Android package with their APIs, etc. Then maybe a generic package with the least-common-denominator. I don't know, haven't looked at the specifics.

    Also, you're going to want to be able to embed native controls inside FX to be able to do things like host advertisements in the application. That will require some work on Glass / Prism when it is open sourced.

    Richard
  • 122. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    Tobi Newbie
    Currently Being Moderated
    Richard Bair wrote:
    In the meantime we could discuss the main technical challenges to bring Java(FX) to Android, iOS and Windows 8:

    1. Porting JavaFX glass/prims to iOS (OpenGL ES2), Android (???) and Windows 8 (DirectX???)
    You actually will end up wanting to use OpenGL ES2 on both iOS and Android (having done the comparisons, the Prism stack on ES2 on Android is as fast or faster than native android graphics).
    Is there a prims stack port for Android available? Where did you get your comparison results?

    On Windows 8, you use Direct3D the same as on Windows desktop, but you have to use WinRT instead of Win32 for the windowing etc. So there is definitely porting work on the Glass/Prism layer for Windows.
    >
    2. Bundle Java/OpenJDK within the app so that it's only one binary (static linking, no dynamic library loading!) (keywords: AOT (ahead of time compiler), Java-to-native-compiler, OpenJDK zero, shark, JNI, ...)
    This is actually the biggest challenge IMO (in fact there is a thread on OpenJDK about porting OpenJDK to Android). I don't know off the top of my head if the JavaSE Embedded VM is open source -- I thought it was, or it was planned to make it so, but I could be wrong. In any case, getting a VM that runs on the platform is easy enough, getting JavaSE class libraries which pass the TCK is where I expect the majority of the work to be (porting FX to those platforms is fairly straightforward and with all the performance work we've already done in 8, you're starting from a pretty good place in terms of performance).

    There are some interesting VM options you could give a try, such as Excelsior Jet or even XMLVM or LLVM. You might want to give a look to XMLVM, its kind of wild. You don't need AOT on Android, but you will on WinRT & iOS.
    Which VM options do you mean? What about the old "GNU classpath JVM" project (compiling to native)?

    >
    3. Shrinking JDK to a minimum (10MB instead of 140MB)
    Actually you don't care about the JDK, but the JRE. Now, we've got the JRE + JavaFX down to about 20MB I think, but if you use an aftermarket tool like ProGuard then you can strip out methods and such you don't use, not just classes. FossilGame for iOS was down to 18MB for the entire app, 20MB with retina splash screen using this technique. One big part of this is getting the SE Embedded VM (or some other VM) which is small, even with AOT. That, I suspect, will be a technical challenge.
    Do you mean the windows JRE? When I use AppBundler I have to bundle a JVM which is round about 140MB (uncompressed)!

    >
    4. native look and feel (skin, css, ...) and native looking components (e.g. date chooser on iOS, lists, tab bar, navigation, ...)
    This is dead easy and can all be done via CSS. See the blog post on FX Experience where Jasper does skinning of buttons, and includes some Windows / iOS buttons. Also, the JavaOne scheduler app (which is open source in the OpenJFX 8 repos) we did an entire popover control with skinning etc so it looks like native iOS popovers.
    Yes I already started a project for creating an iOS theme for JavaFX.

    >
    5. access to native features (like Phonegap/Cordova do it) like camera capture, geolocation, music library access on tablets, ...)
    Ya, right now just use JNI. We played with something more like the underlying mechanism that Eclipse uses which generates Java classes to call into various APIs but doesn't have hardly any native code, but it isn't released anywhere. Some APIs would be worth having a cross platform implementation, but honestly for most of these things, you want to have every single capability of the host platform available so that you can get really good, deep, native integration. So I would expect to have an iOS package with camera, geolocation, etc APIs available, and an Android package with their APIs, etc. Then maybe a generic package with the least-common-denominator. I don't know, haven't looked at the specifics.
    Yes I think we could see all the implementation work on the open source project "Cordova" (aka Phonegap) (http://incubator.apache.org/cordova/) So we only have to port it ala "PhoneGap for JavaFX".
    Also, you're going to want to be able to embed native controls inside FX to be able to do things like host advertisements in the application. That will require some work on Glass / Prism when it is open sourced.
    Yes you are right, that's important too.
    >
    Richard
    Thanks Richard for your really qualify answers.
  • 123. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    933391 Newbie
    Currently Being Moderated
    Now that's the news!!! I think this thread is now to be considered replied ;)
    Go oracle and please don't cock this up!
  • 124. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    933391 Newbie
    Currently Being Moderated
    on a closer read, there's still no explicit mentioning of JavaFX only HTML5... however, once Java will be running on iOS, I think it is just a matter of time for this to happen.
  • 125. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    933391 Newbie
    Currently Being Moderated
    to me it looks as if oracle chose the cheap way. they want java to be available on the mobile platform but they don't want to spend too much on it :) so they are not porting JavaFX now, but instead choose a UI technology which is already ported. While this approach is certainly reasonable, it does read as if they were abandoning their freshly invented UI toolkit, JavaFX. Also, questionable how attractive this package will be for Java developers. If they manage to wrap HTML with something Java-like, it may be ok, otherwise it won't be too attractive for Java folks.
  • 126. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    969259 Newbie
    Currently Being Moderated
    I am not sure I read this like you do. My read is:

    1- The possibility of compiling JVM bytecode to run on mobile environments is still alive. Otherwise, Richard would not be following and commenting on this thread.
    2- It seems Oracle wants to rely on open source initiatives to deliver this
    3- Oracle has a product that competes with Cordova, that uses HTML for the UI, with compiled Java. However, there is a difference between compiling Java source code to native code (something which Google and others already do) and compiling JVM bytecode to native iOS/Android/W8 (which would allow you to develop a wider range of applications and use a much wider range of tools). This last option is the really interesting one.
  • 127. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    875756 Pro
    Currently Being Moderated
    My understanding of the goal was that we wanted to take the OpenJRE source code and create some alternate versions of the native-level libraries (prism and what-not) that would allow the OpenJRE to run on Android. Additionally we would need some make scripts or something to build a distro of that Android-specific JRE, ideally stripping out all the OpenJRE source code that we don't want.

    Basically I was assuming that we would be more or less running it in a similar way to how the co-bundled native installers work.

    Am I way off? Sounds like it?

    Admittedly I know very little about the internals of the actual JRE so no doubt I am missing some fundamentals. I definitely don't understand a lot of Richard's comments and don't get what role XMLVM or LLVM play, or why AOT might be needed or not (or even what that means at an implementation level).

    I'd be super happy if there was someone else out there who know more wanting to make this happen. Unless someone does though, you're stuck with jre-native-newbies like me. If someone can get me started I might be able to muddle it out - up to you to decide whether that's worth the effort, or whether it's better to wait for someone who has more base knowledge in this area.

    Basically I would need some simple, clear direction on what actually, physically needs to be done to get to the JavaFX HelloWorld running on Android.

    e.g.

    step 1: check out the JRE source code from xxxx onto a linux box
    step 2: get it compiling on that linux system as a starting point
    step 3: write native replacements for components X, Y, Z (using an Android emulator to test, or what?)
    step 4: write some make scripts to bundle it all up into a distro
    ...


    I have a feeling I am miles off from what needs to happen. Point me in the right direction and maybe I'll work it out.
  • 128. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    MiPa Pro
    Currently Being Moderated
    After all that reading I think there is a lot of work to do which will take a fair amount of time if you want to get the Java VM and JavaFX on all the mentioned platforms in parallel. I wonder how much easier (and quicker) it would be to just port JavaFX over to Android running on the standard Dalvik VM and infrastructure. This way one might get a working solution much faster and by experimenting with it one would gain a lot of experience which will be helpful for the other ports.
  • 129. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    966614 Newbie
    Currently Being Moderated
    MiPa wrote:
    After all that reading I think there is a lot of work to do which will take a fair amount of time if you want to get the Java VM and JavaFX on all the mentioned platforms in parallel. I wonder how much easier (and quicker) it would be to just port JavaFX over to Android running on the standard Dalvik VM and infrastructure. This way one might get a working solution much faster and by experimenting with it one would gain a lot of experience which will be helpful for the other ports.
    I was told at JavaOne that Oracle already has JavaFX running in-house on both iOS and Android. Not sure why we can't just get our hands on that, instead of trying to reinvent the wheel.

    Corporations are going for HTM5 for the 'write once, run anywhere' factor, something that Java already has and can leverage on these new platforms.

    IMHO (all $0.02 worth), Oracle is being 'Penny Wise, Pound Foolish', in waiting for the open-source community to do what they should already have done and should continue to do.
  • 130. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    bouye Journeyer
    Currently Being Moderated
    Adrian Romanelli wrote:
    I was told at JavaOne that Oracle already has JavaFX running in-house on both iOS and Android.
    Yes, I remember that too from 2011 BUT I also remember that the "safe-harbor" slide was much more present last year's than this year's. ;)
  • 131. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    966614 Newbie
    Currently Being Moderated
    bouye wrote:
    Adrian Romanelli wrote:
    I was told at JavaOne that Oracle already has JavaFX running in-house on both iOS and Android.
    Yes, I remember that too from 2011 BUT I also remember that the "safe-harbor" slide was much more present last year's than this year's. ;)
    Not sure if you realized this or not in my post, but I was talking about 2012's JavaOne, the one we just had.

    What we're asking for is already coded. We just need to convince Oracle's management that their long-term benefit is to support JavaFX on mobile platforms over their short-term profit gain from ADF. Not that I don't blame them, as everybody talking right now uses the phrase "HTML5" in every sentence, so JavaFX is in theory a hard sell, but still, its really about WORA, and Java has the high ground on that (but is losing it QUICKLY to HTML5).

    Its their WORA game to lose.
  • 132. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    875756 Pro
    Currently Being Moderated
    Its really about WORA, and Java has the high ground on that (but is losing it QUICKLY to HTML5). Its their WORA game to lose.
    Nicely put.
    told at JavaOne that Oracle already has JavaFX running in-house on both iOS and Android. Not sure why we can't just get our hands on that, instead of trying to reinvent the wheel.
    Richard, since Oracle doesn't want to support Android/iOS, is there any reason why you can't just throw us the code to work with?

    Alternatively could you not outline what strategy/steps were used to make it work, what was needed to be done to get it there etc?

    You have asked for contributions from the community on this, can you provide a little support to get the ball rolling?
  • 133. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    RichardBair Journeyer
    Currently Being Moderated
    told at JavaOne that Oracle already has JavaFX running in-house on both iOS and Android. Not sure why we can't just get our hands on that, instead of trying to reinvent the wheel.
    Richard, since Oracle doesn't want to support Android/iOS, is there any reason why you can't just throw us the code to work with?
    I can't really comment on that.
    Alternatively could you not outline what strategy/steps were used to make it work, what was needed to be done to get it there etc?

    You have asked for contributions from the community on this, can you provide a little support to get the ball rolling?
    I can definitely do that. I'll write a blog post on both how we went about the iOS and Android prototypes.

    Richard
  • 134. Re: JavaOne 2012: JavaFX on iOS, Android and Windows 8 Metro???
    MiPa Pro
    Currently Being Moderated
    Richard Bair wrote:
    Alternatively could you not outline what strategy/steps were used to make it work, what was needed to be done to get it there etc?

    You have asked for contributions from the community on this, can you provide a little support to get the ball rolling?
    I can definitely do that. I'll write a blog post on both how we went about the iOS and Android prototypes.
    That would be awesome.
    Michael
1 7 8 9 10 11 13 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points