> We currently don't have a good story for this especially since, as you > found and said in your first post, the R class package depends on the > project. One solution is to move android-agnostic code in a separate > project building a jar library that you then package in your various > android projects. It's not ideal though. Unfortunately this is not really a solution for me. Let me try again. I have the same android-dependent code with references to R.layout and all that stuff. So now i want to create two applications with intent to put them on the market. To do that i'll have to have different packages in manifest, which will lead to the fact that R.java will be generated in two different places. Which will make my references to R from my android code not resolving. So for two of them it's not a big deal - i'll add import to both packages and everything will be ok. But what if there 50 apps ? Crazy and not real example:
Let say i've developed an app that shows me everything about NHL team (it's a playoff time after all ). Now i want to publish following apps com.mynhl.capitals com.mynhl.wings com.mynhl.penguins Android code is the same and i want to keep it the same . res folder is different for each team. Drawables and other properties ( for ex tracking ids, and settings specific to each team ) so to make all that compile to each file that has a reference to R. i'll have to add. import com.mynhl.capitals.* import com.mynhl.wings.* import com.mynhl.penguins.* And then by using ant get res-capitals as need resource folder. And yes, of course i've used android_rules.xml as a template and pasted in after <setup import="false" /> Now i'm looking for better way of handling all that. I don't have any android-agnostic code .The ideal would be an ability specify your resource package separately from application package. > > >> For your post subject: what identifies an application is the package > >> name that you provide in the AndroidManifest.xml. > > > I'm very well aware of that . > > >> As for Ant, you shouldn't create the project manually. Instead use the > >> android tool: > > > That just doesn't make any sense. Why i can't create it manually > > again ? > > The ant project uses a sophisticated build.xml file and no offense but > you are unlikely to figure it out magically -- looking at an existing > one is the best way to understand it. > > Starting with SDK 1.5_r1, the build.xml actually doesn't contain much > anymore. Most of the rules are in the > sdk/platform/android-1.N/templates/android_rules.xml. We designed that > new structure to make it easier for people to customize the part of > their build yet let us update the platform specific rules in later > sdk. > > I strongly suggest you create a skeleton ant project using the > "android create project" command-line and look at what has been > generated. Then feel free to modify it as you wish. > > R/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---