Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm new to Android development, and was wondering how the following could be achieved within the confines of the Android market as a distribution channel:

  1. One main application, which handles the main menu, networking, high scores, etc.

  2. Several games which can be launched from the main menu, which all work within the same eco system. The main application is not just a pseudo launcher for other games, these different games will share high scores and other achievements/preferences.

In a traditional package management system such as apt, pacman or yum, this could be handled quite happily through dependencies. This does not appear to be possible via the Android market. The closest I've seen is when apps scan to check if the required app is installed, and if not, launches the market and asks the user to download the app.

This sounds like a very messy solution.

It also begs the question, would they download the game (plugin) first, which then downloads the main shell application? Or would they download the main shell application, and when they navigate to a menu item which says "Play game", then it scans for any installed games, and if none exist, redirects to the market? Also, I'm not even sure if it is possible to dig up the package from another application on the device, and start invoking classes from within (e.g. when you want to launch the game (plugin))

A final option is just to have a 3rd component which is a .jar that each game includes, which effectively contains the entire shell application. Then each game would appear to have the same menu, but it would become a nightmare as soon as you want to update the menu component and have to re-release each game. It would be especially worse if other people released games (plugins) based on the same framework and didn't update them.

Is there any other options which I haven't thought of?

Has anyone else solved this or seen a solution in any apps they've installed (doesn't have to be games)?

cheers.

share|improve this question
add comment

1 Answer

You could use the Android Intent system.

Explaining it fast: each application should have one main activity. They doesn't have to be on the same application as the launcher. The point is, when the launcher need to open another game, it send an intent to open the desired game.

With intents, you can call activities with some data from any application. You can exploit this ability to send an "MAGIC" to the game activity. That way, you can let only the launcher open the game. Also, there a thing that may be interesting to you on the Android Play Store(new Android Market), you can make an apk "not runnable". This kind of apk is not shown on the launcher. It's used often to send themes via market. I'm not sure if you can send just an activity, or an package, or a full application this way, but it worth to take a look.

Accordingly to your comment:

Thanks, that would seem to work well once all of the apks are on the device with the main app being "runnable" and each game/plugin would be "not runnable". However, are you aware of how this would impact the install process? e.g. When you open the Play Store when neither the main app nor any games were installed, would you expect them to proceed by 1) Downloading the main app, which redirects to the Store to download more games? 2) Download games, which redirect to the Store for the main app (if not installed)? I imagine 2) is not possible if the game is "not runnable".

My answer:

Yeah, 2) is not possible. The player cant open the game, so it cant get redirected anywhere. I'm almost sure that you can't make a app need another to be downloaded(Like being unable to download apk X if apk Y isn't installed) That's why yet, some big publishers still put on their games descriptions things like "NEED ADOBE AIR" etc etc for requirements. In my view, that's all you can do for now. EDIT: I Forgot lol: 1 is totally possible. You can make your "play" button on the game turn into a "install" button if the user doesn't have the game. And make this button redirect to the Play Store

share|improve this answer
    
Thanks, that would seem to work well once all of the apks are on the device with the main app being "runnable" and each game/plugin would be "not runnable". However, are you aware of how this would impact the install process? e.g. When you open the Play Store when neither the main app nor any games were installed, would you expect them to proceed by 1) Downloading the main app, which redirects to the Store to download more games? 2) Download games, which redirect to the Store for the main app (if not installed)? I imagine 2) is not possible if the game is "not runnable". –  Peter Serwylo Mar 22 '12 at 1:24
    
I edited the answer. See my edit :) –  Gustavo Maciel Mar 22 '12 at 1:31
    
Alrighty, I suppose 1) would be the only option now. I think that it could even come with a game bundled with the main app, so the user can start playing without having to revisit the Store. Perhaps I could even use something like this market api to generate an in-app list of available plugins, rather than redirecting to the market. Then when they select games from the in-game menu, it redirects to the Store. I'll leave the question unanswered for now, but if nobody has a better solution in the next day or two I'll accept this. Thanks. –  Peter Serwylo Mar 22 '12 at 2:09
    
This may also help you: stackoverflow.com/questions/5074695/… sending the game launcher and the game in the same apk may be a good choice –  Gustavo Maciel Mar 22 '12 at 3:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.