Add native Android second-screen companion - #387
Open
kennethreitz wants to merge 1 commit into
Open
Conversation
kennethreitz
marked this pull request as ready for review
July 29, 2026 11:36
Owner
|
screenshot please |
Author
Owner
|
can u do me a favor? only additions or modifications to the api to make this possible as a mod should be committed and then release as a mod. if this is possible without modifications at all, release as a standalone mod. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TL;DR
What changed
Android builds now publish a small presentation-only JSON snapshot from the live game every 300 ms when its contents change. The snapshot includes:
GameActivitydiscovers active displays each time it resumes. When the game is running on the largest active display and a distinct smaller display is available, it shows a native OLED-blackPresentationon that smaller display. Display IDs are never persisted, so panel power changes and Android display reassignment are handled on the next resume.The presentation is both non-focusable and non-touchable. It is owned by the game activity rather than launched as a second activity; this keeps controller focus with the game and avoids Android's resumed-activity ANR behavior for windows that intentionally cannot take focus.
If only one display is active, the game was launched on the smaller display, or display presentation fails, the companion is withheld and normal behavior continues.
Why
Dual-screen Android handhelds such as the AYN Thor have enough room to surface useful RPG state without covering the game. The companion makes that space useful while remaining optional by construction and preserving the ordinary single-screen path.
Validation
lua tests/second_screen_test.lua— 15/15 checks passedscripts/build_android.sh—assembleEmbedNoRecordDebugsucceededNOT_FOCUSABLEandNOT_TOUCHABLE