Looks like I need to use the "--custom-package" parameter. Hope this helps someone else out there.
On Tue, Jun 15, 2010 at 11:55 PM, Jeff Thorn <[email protected]> wrote: > Hi Dianne, > Can you clarify what that mechanism is? I tried adding the last to lines to > the and target that generates the resource classes. There isn't much > documentation, so I am not sure if I am using the correct parameters. > > <!-- Generates the R.java file for this project's resources. --> > <target name="-resource-src" depends="-dirs"> > <echo>Custom Generating R.java / Manifest.java from the > resources...</echo> > <exec executable="${aapt}" failonerror="true"> > <arg value="package" /> > <arg line="${v.option}" /> > <arg value="-m" /> > <arg value="-J" /> > <arg path="${gen.absolute.dir}" /> > <arg value="-M" /> > <arg path="AndroidManifest.xml" /> > <arg value="-S" /> > <arg path="${resource.absolute.dir}" /> > <arg value="-I" /> > <arg path="${android.jar}" /> > <arg value="--rename-manifest-package"/> > <arg value="com.mybase.app"/> <!-- THIS IS THE PACKAGE NAME I > WANT R.java to have --> > </exec> > </target> > > > > On Tue, Jun 15, 2010 at 11:11 PM, Dianne Hackborn <[email protected]>wrote: > >> The Froyo aapt will have a mechanism to build an existing package under a >> new name without modifying any of its source, manifest, or resources. >> >> On Tue, Jun 15, 2010 at 7:50 PM, Jeff Thorn <[email protected]> wrote: >> >>> I looked into Library Projects, but I am not sure if that helps me. I >>> assume I would put the Activity in the library, since it is what is used by >>> each "app". However, that Activity relies on String values from >>> res/values/strings. Each "app" will have different strings. Therefore the >>> activity calls R.string.something to get the string from the resource. >>> >>> In order to make each app its own unique app, I need to change the >>> "package" attribute of <manifest> element in the AndroidManifest.xml. This >>> has the unfortunate side effect of generating the R class with the app's >>> custom package name. Therefore, when the Activity common code base tries to >>> look up a string using the R class, it cannot find the class since it has a >>> different package name. >>> >>> At this point I am thinking about creating an Ant target to replace the >>> package name in R.java. However, I feel like there has to be a better way. >>> >>> Am I overlooking something? Can this be accomplished with libraries? >>> >>> >>> On Tue, Jun 15, 2010 at 10:00 AM, Mark Murphy >>> <[email protected]>wrote: >>> >>>> On Tue, Jun 15, 2010 at 9:47 AM, Jeff <[email protected]> wrote: >>>> > Any other suggestions? >>>> >>>> Try the new "library project" featured added in the latest edition of >>>> the dev tools: >>>> >>>> >>>> http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject >>>> >>>> http://developer.android.com/guide/developing/other-ide.html#libraryProject >>>> >>>> -- >>>> Mark Murphy >>>> CommonsWare >>>> [email protected] >>>> http://commonsware.com >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Android Developers" group. >>>> To post to this group, send email to >>>> [email protected] >>>> To unsubscribe from this group, send email to >>>> [email protected]<android-developers%[email protected]> >>>> For more options, visit this group at >>>> http://groups.google.com/group/android-developers?hl=en >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Android Developers" group. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> [email protected]<android-developers%[email protected]> >>> For more options, visit this group at >>> http://groups.google.com/group/android-developers?hl=en >>> >> >> >> >> -- >> Dianne Hackborn >> Android framework engineer >> [email protected] >> >> Note: please don't send private questions to me, as I don't have time to >> provide private support, and so won't reply to such e-mails. All such >> questions should be posted on public forums, where I and others can see and >> answer them. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected]<android-developers%[email protected]> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

