Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open game using Intent API or am command #69

Open
leonstyhre opened this issue Feb 8, 2024 · 4 comments
Open

Open game using Intent API or am command #69

leonstyhre opened this issue Feb 8, 2024 · 4 comments

Comments

@leonstyhre
Copy link

Hi!

Is there a way to launch a game from an Intent API call or via the am command?
I looked at the AndroidManifest.xml file and tried some different things but I couldn't get it to work.
Thanks!

@torokati44
Copy link
Member

Hi!

Well, admittedly, I'm not that well versed in these Android-specific things, so I'm not sure...
But the <intent-filter> is supposed to register the VIEW intent to be handled by this app, no?
That is what makes is possible to simply open an .swf file from, say, the Files (by Google) app, and have Ruffle show up in as a choice for what to open the file with...

So, if you can, when dispatching the intent, perhaps specify a preference towards the app ID as handler, maybe that could work...?

@leonstyhre
Copy link
Author

Thanks for the really quick reply! I managed to get it to work using an explicit Intent and the android.intent.action.VIEW action in combination with the FileProvider API.

FYI I'm developing an Android emulator frontend (https://es-de.org/) so very nice to have this integrated :)

By the way, is there any plans to add a way of exiting the game? This would be nice as it would return the user directly to the frontend after he's done playing a game.

@torokati44
Copy link
Member

By the way, is there any plans to add a way of exiting the game?

Doesn't the "<-" button in the top left do just that? 🤔

@leonstyhre
Copy link
Author

The arrow icon goes back to the Ruffle start/game select screen, normally when you run games from a frontend you want to be able to exit the emulator completely and go back directly to the frontend and select the next game from there. Maybe there could be a possibility to add an "X" or similar as well to close Ruffle completely directly when playing a game?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants