Building JavaFX for Android with skia library.
By PictureCo on Nov 22, 2013
I hope you've tried and succeeded to build JavFX runtime for Android following my blog post How to build OpenJavaFX for Android. Here's a short tweak how to make a freetype library significantly smaller. The result should be functionally identical just instead statically linking freetype of 1.5Mb size we will use on-device library skia. The powerfull skia graphics framework already contains freetype and harfbuzz (complex text layout). Although developers are discouraged to use skia directly since it hasn't public api we could give it a try because the change in build script is very minimal. Every kilobyte matters if you have to repeatedly deploy application to a device.
You will still need freetype headers for compilation but instead libfreetype.a you will use libskia.so. Firstly download libskia.so from your device.
Open and edit android.gradle. Go to very bottom and look for ANDROID.fontNativeFreetype.linkFlags and change the name of library to link with. If you've done it like myself e.q. put it along with libfreetype.a to the same directory the script will look like that:Now just run build and here we go.