openmw-android icon indicating copy to clipboard operation
openmw-android copied to clipboard

Added app shortcut to instantly launch game

Open rozPierog opened this issue 6 years ago • 8 comments

Hi @xyzz great work on android version of OpenMW. I've wanted to help and resolve https://github.com/xyzz/openmw-android/issues/21 It goes without saying that its more of a POC and not a final implementation, would love some pointers from you about, naming, code and shortcut appearance.

rozPierog avatar Oct 06 '19 18:10 rozPierog

Are those "imports" useless and needed to be removed?

licaon-kter avatar Oct 06 '19 19:10 licaon-kter

@licaon-kter Yeah, Android Studio removed them automatically, so I guess that they are not needed anymore.

rozPierog avatar Oct 06 '19 19:10 rozPierog

Is there a reason this is a dynamic shortcut instead of a static one? It seems the same functionality could be implemented with a static shortcut, as in https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts#static

xyzz avatar Oct 06 '19 22:10 xyzz

I totally forgot about static shortcuts. I'll rewrite this later today. Thanks

rozPierog avatar Oct 07 '19 05:10 rozPierog

@xyzz I've changed it to static. Sadly I couldn't find reliable method of getting application_id inside .xml file so I decided to make shortcut release type only, because of different application_id in debug mode. I can bypass it by creating alternate shortcut for debug mode or adding application id to strings.xml let me know which way you prefer.

rozPierog avatar Oct 07 '19 14:10 rozPierog

The shortcut working in debug would be nice to have but not overly important. However, the current implementation won't work for is.xyz.omw_nightly, which is a separate build flavor. Should probably do it similar to https://stackoverflow.com/a/51518675

xyzz avatar Oct 12 '19 17:10 xyzz

@xyzz While adding shortcuts to nightly I've decided to add them to debug as well. Sorry for a long delay on this PR 😉

rozPierog avatar Nov 01 '19 07:11 rozPierog

Hmm, I've tried it out again, and a problem it introduces is that if you run the game, then minimize and run again through the shortcut, it is restarted instead of resumed. I suspect this shouldn't be how it's supposed to work, can you confirm?

xyzz avatar Nov 02 '19 02:11 xyzz