You'll likely need to root the phone to get the OS not to kill the termux process due to idleness though.