Ubuntu is GNU/Linux, you don't run Afterstep on Android via NDK, unless you rewrite X Windows or Wayland to run on top of OpenGL ES or Vulkan surface that is then hosted inside a AndroidView or JetpackCompose display surface.
Which is what Termux has to do, just like they have to call into specific Android services via JNI, as the NDK only exposes official NDK APIs, alongside the C and C++ standard libraries.