-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 8/18/10 12:19 , Roj wrote: > Hi, Is there any way to change the default location of R.java file > which is getting created in "gen" folder? By default R.Java will > get created in gen folder under the package (of the application) > directory. > > I have a common code (with UI) which has to go with different > applications with different package names/branding. When ever I > change the package name in manifest file, R.java will created > inside that package so I have to change the import statement in all > the files with the new location of R. How I can avoid it? Also is > there is any provision to have two or more R files in one > application? There are at least two ways to deal with that - I'm enumerating them and also taking the chance of asking to the list if there are some relevant consequences in choosing one or the other.
1. You can trick your build system with two AndroidManifest.xml files. The former has e.g. com.acme.app as the package and thus com.acme.app.R is generated. Just before you run the packager you replace/tweak it by changing the package name. This is relatively simple to do with Maven and is described here: http://groups.google.com/group/maven-android-developers/browse_thread/thread/56b2449756fd4a40?fwc=1&pli=1 - - I suppose you can do the same with ant. 2. aapt has got the --rename-manifest-package option that seems to do the trick as well. I'm going to need this soon as I would keep separate package names for the official releases and the snapshot builds, so I can install both at the same time. - -- Fabrizio Giudici - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." java.net/blog/fabriziogiudici - www.tidalwave.it/people fabrizio.giud...@tidalwave.it -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxsQ8QACgkQeDweFqgUGxcjHwCeNNL5zXn3AZGovnbzjDKr6B1A z4UAnRFJQi3GK2LrZdtd/dYh/9q/8VLx =7Wot -----END PGP SIGNATURE----- -- 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