Android emulatorview text is not displaying correctly

Viewed 199

after playing around for many hours (2 days), cannot figure it out why this is happening and how to solve it.

I am using emulatorview for Android: https://gitlab.com/termapps/termoneplus/-/tree/master/emulatorview and Speed Test python script: https://github.com/sivel/speedtest-cli/blob/master/speedtest.py

After managed to compile Python 3.10 for Android, tried to execute from adb shell Speed Test script and it runs and displays correctly.

But when trying to execute it from java code and display it to the emulatorview it shows a weird text position in the view.

The next line is displayed at the end of the previous line before it, normally it should be displayed at the very left part of the screen as new line.

The attached image explains better what i mean: enter image description here

The initialization of emulatorview and execution is as following :

lateinit var emulatorView: EmulatorView
private var session: TermSession? = null

val execBuild = ProcessBuilder(context!!.applicationInfo.nativeLibraryDir + "/libpython3.so", "/data/local/tmp/speedtest-cli-master/speedtest.py")
execBuild.redirectErrorStream(true)
val exec: Process? = execBuild.start()

session!!.termIn = exec!!.inputStream
session!!.termOut = exec.outputStream

launch(Dispatchers.Main) {
    emulatorView.setDensity(requireActivity().resources.displayMetrics)
    emulatorView.attachSession(context, session)
    emulatorView.setTermType("linux")
    emulatorView.setTextSize(textSize)
}

Any idea how to solve that problem ?

P.s sorry for my English, hope to be enough understandable :)

0 Answers
Related