Desktop (launcher) shortcuts not working if Magic DosBox is already running

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4031
    flamming_python
    Participant

    Hiya,

    I found that the desktop shortcuts for games I create work absolutely fine and launch straight into the game.. provided that Magic DosBox is not already running.

    If it is already running then they just take you straight to where it was when you escaped from it.

    Now this makes sense I guess if you have a game launched – you might not want to inadvertantly reset the emulator and go into another game.
    However it happens even if Magic DosBox was just in the menu/its own desktop – you’re taken right there and the game isn’t launched.
    It strikes me that the expected/ideal behaviour would be for the shortcut to launch the game, not just take you into Magic DosBox if it’s already running

    #4039
    admin
    Keymaster

    Unfortunately this is probably not possible. It’s all about android activities lifecycle and launch mode (magic dosbox uses singleTask for all activities). You must close mDosbox with back button or X. If you are interested look here :

    Android: Understanding Activity launch mode

    Magic Dosbox has two activities. First is main menu. Pressing game in menu finishes first activity and starts second activity (game).

    Minimizing with home button does not close application immediately, in this case is closed by system when system needs more resources.

    If you press icon from launcher then launcher sends newIntentEvent to main menu activity. And if intent contains game hash then is automatically closed main menu and started game (this is handled by mDosbox). This means you go always to main menu, you only don’t see it. Something is handled by system automatically, something by launcher and I can work only with result. If you press the icon from launcher then is on system what is started – it may start new main menu activity or it may resume to main menu. Which action is picked is handled by system. If is started new main menu activity and is present game hash is in startup parameters (inserted by launcher) then I start game else is started main menu.

    #4046
    flamming_python
    Participant

    I discovered today that DraStic, the Nintendo DS emulator – also supports creating shortcuts for games; and somehow they’ve managed to overcome the problem – whether the emulator is in the main menu, or within an existing game – whenever you click a shortcut the respective game always loads.

    What about if the shortcut first kills the activity, or the entire task – and then launches it from the beggining? Is that possible? It would be a way around the problem.
    Failing that, you could get in contact with the DraStic dev and ask him how he did it. I would do it myself, but I have very little experience with the Android OS and davlik and I fear that many important details might go over my head.

    #4052
    admin
    Keymaster

    allright, I can try ask him. As I mentioned, I can start the game, but system must provide information stored in shortcut. If system sends empty ID then I dont know which game to start…

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.