X11 client app on Android? lazarus / 43-Android ---------------------------------------------------------------------- dieselnutjob · 2020-11-10 19:04 If I already have a Linux app which uses X11 (I am using fpgui) is there any reason that the same app could not be compiled to run on Android and talk to an X11 server (like XServer XSDL)? I am sure that I managed to compile command line only pascal programs and run them on a phone (probably under Termux) but I couldn't get an X11 app to work. Has anyone else tried or know if it is possible? My code is pure freepascal code (not Lazarus) and uses fpgui to display to X11. ---------------------------------------------------------------------- Handoko · 2020-11-10 19:14 I don't know much about X11 nor Android. But I found some interesting information: The Android X Server is an open source Java implementation that runs on Android devices. Android, which runs on the Linux kernel, uses its own system for drawing the user interface known as SurfaceFlinger. 3D rendering is handled by EGL. Mir is a project from Canonical Ltd. with goals similar to Wayland. Mir is intended to work with mobile devices using ARM chipsets (a stated goal is compatibility with Android device-drivers) as well as x86 desktops. Source: https://en.wikipedia.org/wiki/X_Window_System ---------------------------------------------------------------------- dieselnutjob · 2020-11-10 20:21 Here is an example (http://pscan.uk/images/Screenshot_20201110-201114.jpg) This helloworld executable was compiled on my Pinebook Pro (a 64 bit ARM laptop) using no particular compiler switches. The resultant executable runs fine both on the Pinebook Pro and on my Sony XZ Premium under termux. ---------------------------------------------------------------------- MarkMLl · 2020-11-10 22:08 Is there actually an X11 server that can be installed on an Android device? In the past I've had FPC running on a tablet using Termux, but I've got a vague recollection of having to compile a special variant since some of the directories weren't where expected. MarkMLl ---------------------------------------------------------------------- dieselnutjob · 2020-11-10 23:53 Quote from: MarkMLl on November 10, 2020, 11:08:19 pmIs there actually an X11 server that can be installed on an Android device? In the past I've had FPC running on a tablet using Termux, but I've got a vague recollection of having to compile a special variant since some of the directories weren't where expected. MarkMLl There are two mentioned here https://funprojects.blog/2019/01/18/x-windows-from-raspberry-pi-to- android/ and source code for one here https://github.com/mattkwan-zz/android- xserver I think that these work for exporting X from another machine over a network and displaying it on an Android device, but I suspect that xlibs is going to be needed on the Android device if I want to run an application on the device itself.  I'm not sure if xlibs is available. ---------------------------------------------------------------------- dieselnutjob · 2020-11-10 23:57 There is also a complete desktop called Andronix but I haven't tried it.  So maybe xlib is available. Edit: Andronix required VNC.  I have no idea why.  I guess that there is a "special" X server that can only render to VNC and not straight to the Android screen.  Still, the clients must still have access to xlib, right? ---------------------------------------------------------------------- dieselnutjob · 2020-11-11 00:10 I did try this out https://wiki.termux.com/wiki/Graphical_Environment but I couldn't get it work ---------------------------------------------------------------------- MarkMLl · 2020-11-11 08:55 Quote from: dieselnutjob on November 11, 2020, 12:57:36 amThere is also a complete desktop called Andronix but I haven't tried it.  So maybe xlib is available. Edit: Andronix required VNC.  I have no idea why.  I guess that there is a "special" X server that can only render to VNC and not straight to the Android screen.  Still, the clients must still have access to xlib, right? My understanding is that VNC /is/ an X server. MarkMLl ---------------------------------------------------------------------- PascalDragon · 2020-11-11 11:54 Quote from: MarkMLl on November 11, 2020, 09:55:13 amQuote from: dieselnutjob on November 11, 2020, 12:57:36 amThere is also a complete desktop called Andronix but I haven't tried it.  So maybe xlib is available. Edit: Andronix required VNC.  I have no idea why.  I guess that there is a "special" X server that can only render to VNC and not straight to the Android screen.  Still, the clients must still have access to xlib, right? My understanding is that VNC /is/ an X server. No, VNC and X11 are two completely different protocols. VNC works by transferring rectangles of screen data while X11 (in general) works by transferring drawing operations. To access a X11 server through VNC a tool like X11vnc is needed. ---------------------------------------------------------------------- MarkMLl · 2020-11-11 12:50 Quote from: PascalDragon on November 11, 2020, 12:54:39 pmQuote from: MarkMLl on November 11, 2020, 09:55:13 amMy understanding is that VNC /is/ an X server. No, VNC and X11 are two completely different protocols. VNC works by transferring rectangles of screen data while X11 (in general) works by transferring drawing operations. To access a X11 server through VNC a tool like X11vnc is needed. I *know* that the protocols are different. But my understanding is that on unix (and specifically excluding the root window) the VNC daemon *is* an X11 server, i.e. programs (including desktop environments) use the X11 protocols to talk to the VNC server, which serves what are basically bitmap tiles to the client. My recollection is that there's a bit of "magic" during window manager startup, but it's a long time since I've had to hack the configuration/script files for this explicitly. My usual practice these days is to hang a VNC server onto port 570x, with  the local X11 port being 602x i.e. clear of the ones tunneled by SSH. MarkMLl