Waydroid app launch
Posted: Wed Mar 25, 2026 2:44 am
Im using some of the coding from
Is there a better solution?
The code i am using is
To create a menu button for a android app launched with waydroid. I have successfully created the menu and it launches the app. But when I go to access other areas of hudiy the android app looses focus and I cant bring it back to the front.
Is there a better solution?
The code i am using is
Code: Select all
from flask import Flask
import subprocess
import os
app = Flask(__name__)
def run_game(cmd):
env = os.environ.copy()
# Required for Waydroid / GUI apps
env["DISPLAY"] = os.environ.get("DISPLAY", ":0")
env["WAYLAND_DISPLAY"] = os.environ.get("WAYLAND_DISPLAY", "wayland-0")
env["XDG_RUNTIME_DIR"] = os.environ.get("XDG_RUNTIME_DIR", f"/run/user/{os.getuid()}")
# Optional
env["DBUS_SESSION_BUS_ADDRESS"] = os.environ.get("DBUS_SESSION_BUS_ADDRESS", "")
subprocess.Popen(cmd, env=env)
# apps
@app.route("/draiver")
def draiver():
run_game(["waydroid", "app", "launch", "com.driverdo"])
return "Draiver launched!", 200
# flask
if __name__ == "__main__":
app.run(host="0.0.0.0", port=44408)