scientificware / FXMessages

FXMessages is a communication app like Google Messages but with scientific writing capabilities.

Home Page:https://play.google.com/store/apps/details?id=com.fxmessages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android and IOS ports.

scientificware opened this issue · comments

The purpose of this issue is to discuss about MathML support on Android, Linux , UNIX, IOS, OSX or Windows platforms. Which cross technology to use ?

As far as I can understand Oracle's work and Gluon Team work about JavaFX, JavaFX wraps its own implementation of WebKit.

You use it for Windows, Linux, OSX and ARM platforms. The patch #117, corrects only this native inner JavaFX implementation of WebKit.

To reach IOS and Android you use their inner implementations of WebKit. So I think that #117 has no effect in these cases.

As shown below, Android display (Screenshot 1) differs from Desktop display (Screenshot 2 and 3).

Gluon Team suspects two reasons :

  • (1) they still use JavaFX 8 on Android (hence not the version patched MathML support)
  • (2) they use the native webkit offered by Android itself (and wrap that in a JavaFX WebView)

If I'm correct, blocking factors depend on platform as follows :

  • Desktop : only reason 1 affects the display.
  • Android platform, the reason 2 is probably the main blocking factor but, on the other hand I don't know which API is used to render WebView : WebCore or Blink. Anyway both of them don't support MathML.
  • IOS platform should work fine with MathML but I can't build any applications yet to test it.
    gluon_mobile

What's happen :
The reason 1 (bad JavaFX/WebKit wrapping in JavaFX) explains the mis-aligment when MathML enabled.
The reason 2 (platform native WebKit usage with MathML disabled ou not implemented) explains why we see only aligned characters and without mathematical signs.

Desktop Windows and Linux platform : the JavaFX native MathML support in WebCore has been enabled since JDK7 but it was just buggy until JavaFX 8.192ea and JavaFX11 release.

  • (Screenshot 1) with JavaFX8.162, we can see bad rendering of root or fraction line and also denominator and numerator overlap.

  • (Screenshot 2) with JavaFX 8.192ea or JavaFX11, the root, the fraction line, the denominator and the numerator are at their right place (exactly what I expect).

Screenshot 1 Screenshot 2
screenshot_20180908_171247_red screenshot_20180908_165903_red

With Android : native MathML support in WebCore has been disabled (built with MATHML flag set to DISABLE). In addition I'm not sure that Blink supports MathML yet (Igalia Team should start to implement it). Consequently, JavaFx don't support MathML on Android platform.

  • That's why with Android, we can see only aligned characters without root and fraction line. When MathML is disable, WebView displays only characters on the same line and without the mathematical signs which are not simple characters.
Screenshoot 3
screenshot_20180908-184337_red

With IOS : I can't test but I'm almost sure that it works, because MathML support is enabled by default. (It works with Safari).

Scenario A : If your objective is to use the inner native JavaFX WebKit implementation for IOS or Android, only reason 1 will stay a blocking factor.
This is the best scenario for me :-) Only one code for ever.
gluon_mobile_best_scenario

Scenario B : If your goal is still to use the inner native IOS and Android WebKit implementation only reason 2 is a blocking factor.
This would be the worst scenario for me : works with IOS but with Android it will depend on Igalia and Google agreements.

Also read discussion started with MathML on JavaFX/Android or IOS #228 issue.

Flutter / webview_flutter side

Conversation

Repository

Gluon / Webkit side

Gluon InternalWebView

javafxport InternalWebView

Johan openjfx-dev mailing list announce JavaFX 11 on Android

Gluon / GeckoView side

Replace Android WebView with GeckoView in Android port ? See Firefox Focus with GeckoView

GeckoView documentation Mobile/GeckoView
Delete old geckoview-* directories in Maven's https://maven.mozilla.org/?prefix=maven2/org/mozilla/ directory

before the GV team starts promoting GV to more app developers

Article sur Communauté Mozilla francophone : GeckoView, le futur moteur de rendu dans Firefox Focus

GeckView supports MathML. Firefox Focus (Bêta) uses GeckoView.
screenshot_20181025-173544_red

C.N.O. Side

Try with C.N.O., same result. Of course this is to be expected since C.N.O. browser is JavaFX WebView based.
screenshot_20181006-091028_red

Try to understand what is the differences between :

Gluon Mobile - Single View Project on Gluon VM

Creates a Gluon Mobile based Java application with a single View running on Gluon VM. It is targeted for Android, iOS, desktop and embedded devices, as a Gradle project. The Gradle project applies the jfxmobile plugin to run, build and debug your project.

Gluon Mobile - Single View Project

Using Gluon Mobile, and including a single View by default, creates a new Gluon Mobile based Java application, targeted for Android, iOS, desktop and embedded devices, as a Gradle project. The Gradle project applies the jfxmobile plugin to run, build and debug your project.

Document Gluon VM :

The template called "Single View Project on Gluon VM" creates a project with a build.gradle file that refers to the latest stable jfxmobile 2.x version

Found a light interim solution until I could also use Gluon VM on Android.
The display is not perfect but it's far better than nothing !

screenshot_20181009-002415_red

Found another interim solution for testing until I could also run #118 tests using Gluon VM on Android.

  • Port FXMessages using Android API's, required by the writing and sending test schedule :

    • Display of recorded correspondents. Ok.
    • Display of messages. Ok.
    • Message sending over the mobile network. Ok.
    • Message receiving over the mobile network. Ok.
    • Updating message list. Ok.
    • Message persistence. Ok.
    • Modifiy correspondent list (Add, Modify or Delete). Ok.
    • Try to use GeckoView in place of WebView (increases the apk size +25Mo). Work In Progress : pretty good results with GeckoView. We are just wainting that the multi-CPU Mozilla's gradle script works.
  • Internal tests

    • On sathurday 27 and sunday 28 october 2018. Run with the Android pure version. Ok.
      screenshot_20181029-010431_red screenshot_20181029-010347_red

    • On Monday 29 october 2018. Test with a graphic. Ok.
      screenshot_20181029-034712_red

    • On Tuesday 30 and Wednesday 31 October 2018, improve Android port to be closer to the Gluon version.
      screenshot_20181031-122019_red screenshot_20181031-123115_red screenshot_20181031-122218_red screenshot_20181031-123504_red screenshot_20181208-180313_red screenshot_20181208-175241_red

    • ...

  • External tests from monday 5 november 2018, Led by Léa.

    • Plateform tested
      • Android 9 : Load, install, mathematic writing Ok. sending, receiving Ok.
      • Android 8 : Load, install, Waiting feedback from students or others.
      • Android 7 : Load, install, mathematic writing, sending, receiving Ok.
      • Android 6 : Load, install, mathematic writing Ok. sending, receiving Ok.
      • Android 5 : Load, install, mathematic writing Ok. sending, receiving Ok.
  • Back to remaining #118 issues.

  • Backport all this material, in JavaFX when OpenJFX/WebView Gluon Mobile (VM) for Android ready.

Good news 😍

Bug 1485045 - Make Java parts of GeckoView independent from build ABI r=jchen
This allows us to use the same Java code for any native platform,
enabling a "fat" AAR.

Differential Revision: https://phabricator.services.mozilla.com/D11497 se et