runs on PC, Mac, web, and on mobile – Problem: Java doesn't run everywhere • But I like Java – Found a way to write in Java – Deploy everywhere using JavaScript VMs • Overview of my experiences – What I’ve tried – What works, etc
Text and icon • Extra space for internationalization • Long press and dragging • Keyboard support for accessibility • Touch support • Simultaneous keyboard/mouse/touch/stylus actions? • Scripting support for testing • High dpi and HDR support • Should look different when pressed • Different look when enabled/disabled • MVC syncing on data/state changes • Alignment and layout
each UI framework that you have to learn – Do widgets have sizes after creation? After being added to the screen? In a later stage after layout? – How do you alter the default behavior of certain events? • Why learn it five times for five different frameworks?
– No time to learn multiple UI systems – No time to rewrite code for each platform – HTML5 is available for all platforms • HTML5 skills will always be useful because of web – Learn HTML5 really well and use it everywhere
– Mac cultists who insist on native UIs with no jank are insane – Not even native applications on the Mac are consistent • Users know how to use websites, they can figure out how a web UI on multiple platforms
– I've deployed an app with a single code base across many platforms • It requires some UI / Java / JS expertise – Hopefully, it will get easier for others
Has good integration, but underdocumented • How does garbage collection work? – Missing efficient transfers of typed arrays etc. • Ported Elemental to map all JS objects to Java – Manipulate a web page from Java using DOM API – Made new Elemental alternative called DOMjnate • https://github.com/my2iu/Domjnate • Mostly works – Can even use the Java debugger etc
Poor performance for heavy computation • Sandboxes – No file access – No foreign functions • API is bizarre – Some parts are very mature – Some parts are a joke (multi-threading, font handling, widgets, MVC, text entry with IMEs, etc) – New UI frameworks every year
bad actually – The top Java VM people work on Chrome's V8 VM – Has a low level semi-typed subset • Typed arrays, inferred types for classes and arrays – Still not great for very heavy computation • Floating point representation • Can use WebAssembly for heavy computation • VMs are reasonably robust – Used for servers and long-running client code
– People keep saying it's dead, but it works great • Documentation is years out of date – Most docs refer to stuff that no longer exists – No idea how to create a new GWT project – I modify an old version that I created using some docs I found in a forum post years ago • But once it works, it works fine – Occasionally need to reset caches and stuff
JavaScript apps on mobile platforms – Especially useful on iPhone • No garbage collected languages except for C# and JS • Cordova itself is primarily an Adobe project? – Maker of other “enterprise” software ecosystems like Adobe Flex
docs are confusing – Often still need to learn Android/iOS, then how to do the same functionality in Cordova • Have you actually saved any time? • Lots of plugins for doing native stuff in JS – Written by JS programmers • JS async API limitations of iPhone and Android
devs by Intel – Good documentation that's very clear • Electron is made by GitHub – Documentation is sometimes marginally better than a list of method names
to use • Just drop html files somewhere and start it up • Limited functionality, but well-explained, well thought-out – Some additional libraries available for common stuff • Electron is a bit of a pain • Have to write a separate loader to open up initial window • Has more libraries for doing tighter desktop integration – Often need to call in to separate boot process asynchronously to make certain library calls – Some standard HTML5 stuff like file access doesn't work • Need to use Electron APIs for working with it • Moving in direction of the node.js tooling rabbithole – Can't just put web files in a directory any more
big – Just use the native one • Webview abstractions like Cordova are limiting – Most plugins are iffy • Plugin documentation is barebones • Lots of docs for doing stuff natively – We're real programmers! – No need to learn how to wrangle Cordova to get some native feature • Read native docs and implement directly
language in UWP • But it's JS with some weird restrictions and some strange extra lifecycle management APIs that you must follow • Very good bridge with C# – If you can figure out the documentation
big • Safari is pretty fast, and has reasonable (though idiosyncratic) support for latest html5 stuff – Can use WKWebView to embed stuff – Asynchronous API to call into JS or out from JS • No easy means for passing large amounts of data – Mac users tend to lag the latest OS version by a year or two, even though it's free – Embedding process is sloppy, but can be worked around
JS or out from JS – No easy means for passing large amounts of data – Weirdness around Android lifecycle it expects synchronous calls – Possible delays when switching activities? • Old webview has to unload before new one can start?
(30MB of WebKit, 10-20MB of JFX) • Compresses to about 50MB • At the time, had to build my own OpenJDK8 – Very annoying • Building JavaFX was even more annoying – Must dig through .jars to remove unneeded classes • Recently, JDK prebuilt binaries are available – Can use javapackager and modules to prune things • Launch4j to make executable file
code signing cert ($100 yellow pages) $19/$100 Microsoft Dev Account $100/year Apple Dev Account Free $100/year Apple Dev Account $25 Android Dev Account (.Net only for UWP) Objective-C or Swift JavaScript Objective-C or Swift Java or Kotlin Windows StoreMac Store or elsewhere App Store Play Store or elsewhere No sandbox (Medium sandbox for UWP) Light sandbox Heavy sandbox Heavy sandbox Medium sandbox
Studio, but manual creation of installer is possible • Tool called Wix to make MSI installers – Lots of documentation and XML to do something simple (1-2 weeks for an installer that just copies stuff into the Program Files directory) – It might be purposely complicated because the company makes money from consulting on how to build installers
Browsers won’t let you download it – Windows won’t let you run it • Need to purchase a code signing certificate – Picked up a Comodo certificate from Tucows for around $100 – Requires a yellow pages listing (another $100) • People don’t really make Windows applications any more apparently – All code signing web pages are 1990s era stuff
to use Xcode • Mac has no installers – MacOS will “automatically” install things – Stale application caches will drive you insane during development • Signing from outside Xcode possible – Hard to find any docs on how to do this
No Yes Yes Yes Access to native features Through Java If plugins available Some C++ messiness Custom code needed for each platform Synchornous API to native? Yes No Yes No Large data transfers to native? No No Yes No Up-to-date web engine? No Yes Yes Yes-ish Stability Ok Depends on plugins Good Good Expertise Needed Medium Medium Medium High Community Non-Existent Unskilled Depends Depends Size Very large Small Large Small Platform Win, Mac Android, iOS Win, Mac No Windows
Must compile to JS No Access to native features Through Java or C++ Synchornous API to native? Yes Large data transfers to native? Yes Up-to-date web engine? Yes Stability Good Expertise Needed Low because of good docs and frameworks Community ? Size Configurable Platform All
Shared UI code for everything – One codebase for everything – JS ecosystem isn't clean and well-engineered • Very vibrant though • Web didn't make desktop/mobile apps obsolete – Lots of things to learn to deploy client apps
of different toolkits, where they fit in – Flutter – Mono – LibGDX – Unity • Diagram of native UI and common Java code (the Google model) Just say this (no slide?)