There is an interface that must be implemented in the project, but it has an Image object belonging to javafx . How can I convert this object to ImageView or any other project that could be used in a project? Or, if this is not possible, how can I use this object in code to get an image? And also what dependencies need to be added to .gradle in order for javafx work on android ?

 import javafx.scene.image.Image; public interface User { String getUserName(); int getUId(); Image getIcon(); } 
  • you hardly need it at all. replace it with ImageView - Flippy
  • Easier (and more correctly) to make a new interface - iamthevoid
  • one
    As far as I know javafx does not work on android in principle. The platform is not the same. Although if you want you can write your own framework :) - iamthevoid
  • @iamthevoid there is no desire, no opportunity, but this was sent to me in a test task for an Android developer. This is the first time I've ever seen Android use FX. Although on the world stackoverflow they said that it is possible (but indiscriminately) - Hitrene
  • Then you have to look specifically. If you can ignore this method, it is better to raise an exception there, if not, then you should look for options. It can be possible to pull out a drawingCache and use it as a bitmap in imageView, and other parameters can be sketched from Image to ImageView. Pattern adapter or whatever it is called. I’ll not say anything about dependencies, I once had problems with this a few years ago and I don’t go there anymore :) - iamthevoid

0