JavaFX WebView component on Android

I heard that it is possible to launch the JavaFX project on Android

So can you use the powerful JavaFX WebView component instead of Android WebView?

resolvent:

Obviously (to my surprise), you seem to be able to use the JavaFX WebView API in Android (or IOS) applications

Javafxports includes some documentation, where links to some sample projects, one of which is called webdemo, and demonstrates the use of WebView API in migration environment (such as Android or IOS)

>Link to webdemo source

I encourage you to follow the javafxports documentation to build and deploy webdemo projects. I haven't tried it myself

Some background and assumptions

I don't know what is the basic implementation of WebView in the migration environment. For the desktop environment, Oracle maintains a modified branch of WebKit code, which is used as the basic implementation of webengine of WebView. This modified implementation uses the JavaFX toolkit for all rendering operations, so as to avoid stylized UI elements (such as buttons and selection boxes) It looks the same in JavaFX in embedded WebView. The modified implementation also uses Java network code instead of WebKit network code, and many other modifications may be made

My guess is that in the port code, the modified WebKit code base on the desktop system is not used, but the WebKit provided with Android and IOS is used through its API (but this is only a guess, I don't know). In any case, from the perspective of developers, it seems that the actual implementation can be ignored, And you can use the built-in WebView API in JavaFX to obtain the embedded web browser. This makes your code easy to migrate and execute in different environments. As an application developer, you don't have to write the code of IOS or Android embedded web browser API directly, but just stick to the cross platform Java API (hoping to provide all the required functions)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>