passing Context into Application?

Tom Schindl tom.schindl at bestsolution.at
Mon Feb 24 00:43:20 PST 2014


Hi,

I have the same problem in OSGi/Equinox where I want to pass on custom
informations provided by Equinox - and I use the same trick with static.

Tom

On 24.02.14 09:03, Johan Vos wrote:
> I've been working on using the Android API's in a JavaFX application. As
> explained in my blog post at
> http://www.lodgon.com/dali/blog/entry/Using_Android_APIs_in_JavaFX we're
> using a (imo) rather dirty trick.
> The problem is that all Android API's need to be accessed via a Context
> instance. The Java FXActivity that we use to bootstrap the JavaFX
> Application extends Context, but it is only accessible in the JavaFX app
> since we add it as a static field on FXActivity. When FXActivity calls the
> LauncherImpl to start the application, we can't pass context information.
> We can pass String[] but that is not useful here.
> 
> In general, I think the environment that launches a JavaFX Application
> (Android, iOS, script, JNLP, management software,...) may want to pass some
> context information. Of course this context information is very specific,
> with Object being the ugly common denominator.
> 
> I realize it goes against the wora principles, but having the possibility
> to either inject or set a context on javafx.application.Application would
> definitely help using JavaFX in other environments.
> 
> - Johan
> 



More information about the openjfx-dev mailing list