views:

85

answers:

4

I'm working on an app that is meant to be used by fans of a sport team. In the future, I expect to use the same app but for any different team. So, what changes would be the colors, team logo, app name and the like.

So, is there any technique that allows me to build binaries for different teams without having duplicated resources?

+1  A: 

Is it possible to have one binary that contains all the resources and have the user select which team they want from the app itself? Then the app can load whichever resources it needs.

jonescb
Nice... but, what if there are, say, 130 teams? Each team styles+logos could take up to 1MB, so in that case the app will be huge for a handset. Thanks anyway for your answer.
Cristian
You could get the images from the internet after they choose a team
Falmarri
+1  A: 

There may be a better way to do this, but here goes:

Build your app for the first team and make all logos / team names / styles / etc resources. Then just write yourself a script that allows you to delete all the items in the res/ folder of your project and replace them with different items. If you are smart, then most of the string's like team names are included in the logos, so all your script has to do is to delete the old ones and copy in the new ones from some other location on your hard drive.

The worst part about this is that you will have to define android-type file for the styles. It might be good to have your script take as parameters a team primary & secondary color, and actually generate all the android-type style files.

Again, there might be a better way, I am just saying that this way could be a solution.

Hamy
+1  A: 

Probably the best way is to depart from the default build system. That typically means writing custom Ant scripts (or you could use some kind of preparatory script that manipulates the resources prior to invoking the default build).

I've previously sketched an outline of how I achieved something similar.

Dan Dyer
Dan, could you check your outline link? I wanted to read it but it seems to only take me back to this question :(
Hamy
Yeah, sorry. I accidentally replaced the link that was in my clipboard. Should be fixed now.
Dan Dyer
I think this is the only good solution. I have not found anything else that convince me :S
Cristian
A: 

I think build your application which will load the image , colour information from internet / your server. then,

1) ask user for team name which they are following and download image,color information from internet/server and store it as local. don't download next time.

2) attach any global id with each build which will download the image,color information from server first time user installs the application.

sohilv