[android-developers] Re: Best practices for creating multiple app versions from a single codebase?

2010-05-07 Thread Alex (PS3 Friends)
I agree with Bob on this, you should be able to build your system for
release outside of Eclipse entirely, there should be no dependencies
at all with that environment.  A good way to set this up is to use a
Continuous Integration Server like Hudson to do this.  There are even
Hudson plugins that allow you to tag releases in CVS and do some nice
things.  The nice thing about this, you will end up with a clean
environment that Bob was talking about, and it also makes it easier to
move from one machine to another if need be and helps you document and
clean up your build.

Alex

On May 7, 12:08 pm, greg  wrote:
> Hi, Bob.
>
> A description of best build practices would be pure gold to me.  I'm
> nearing an application release (this month I hope) but have not yet
> ventured beyond building it with Eclipse.
>
> - Greg
>
> On May 7, 11:25 am, Bob Kerns  wrote:
>
>
>
> > I don't recommend doing production builds directly in your Eclipse
> > environment.
>
> > Export a copy, and modify that. In fact, I strongly urge checking out
> > a pristine copy from revision control for real production builds.
>
> > I derive my build numbers from the Eclipse revision I'm building. I
> > inject that into the AndroidManifest.xml via an XSLT ant task.
>
> > I've been meaning to write up my build practices for a while; I keep
> > holding off for certain refinements, but I really should get to it
> > soon, since it's a recurring issue for people.
>
> > On May 4, 4:42 pm, Leigh McRae  wrote:
>
> > > Since you talk about a generated ant file tt sounds like you're project
> > > was created using the android tool instead of Eclipse.  Is this
> > > correct?  I spent most of today trying to get a non-eclipse project
> > > going and had some success up until debugging.  I really wanted to use
> > > NetBeans but it looks like Eclipse is doing quite a bit under the hood
> > > for you when it comes to debugging.
>
> > > If you're using an Ant script for the main build, how are you using
> > > Eclipse with it?  I wrote something to inc the version number and
> > > Eclipse really doesn't like the AndroidManifest.xml  file touched.
>
> > > Leigh
>
> > > On 5/4/2010 4:36 PM, Alex (PS3 Friends) wrote:
>
> > > > My solution was to create two different starter classes with different
> > > > packages.  One for the paid version and the other for the free
> > > > version.  Since the package name is used to identify the application
> > > > in the market.  You can use this to customize the app, by setting
> > > > properties in the different start classes.  I modified the generated
> > > > Ant file to switch between the paid/free versions.  I created a task
> > > > that uses regular expression replacements, identifying sections and
> > > > replacing the starting class name depending on what I am deploying in
> > > > the manifest.  You can even modify the XML layouts using this method.
> > > > Essentially pre-processing prior to compilation.  The R class is the
> > > > only issue, you need to make sure you include an * import for both
> > > > packages otherwise it won't work, and you will have to modify code
> > > > each time.  Also, Eclipse gets upset when you change things underneath
> > > > it after compiling the R class, you need to delete the generated
> > > > source directory.  This is the best solution I have come up with so
> > > > far, it's not great but it works for me and it is scripted.
>
> > > > Alex
>
> > > > On May 4, 3:01 pm, Tomáš  Hubálek  wrote:
>
> > > >> I'm thinking about the same thing.
>
> > > >> I believe thathttp://code.google.com/p/maven-android-plugin/couldbe
> > > >> a solution. Maven is very powerful tool for building (we are using it
> > > >> for JEE projects) so I'm sure that it will support also multiple APKs
> > > >> from one source code base.
>
> > > >> But I didn't looked into details yet.
>
> > > >> Tom
>
> > > >> On 4 kvě, 20:37, "E.P"  wrote:
>
> > > >>> Are there any viable approaches for creating multiple .APKs out of a
> > > >>> single codebase?
>
> > > >>> The apps may share the same code, but they could have different
> > > >>> manifest files, different resources, or different external libraries
> > > >>> (for example in an app with both free and paid versions, the free
&g

[android-developers] Re: Best practices for creating multiple app versions from a single codebase?

2010-05-05 Thread Alex (PS3 Friends)
I am using the Eclipse tool also, I feel your pain with not being able
to use Netbeans as natively as Eclipse,   Eclipse is a great tool,
just really used to Netbeans.  It has been a while but I believe I
created the project using the Eclipse tool.  You can then create the
ant script using the Android tool, and modify that and use that
directly.  I might have generated a test project and copied over the
ant script.  Sorry I can't remember the details, I only had to do it
once and it has a been awhile.  I just know the solution to the
problem that "E.P" had with versioning, is easily solved with Ant.
When you do modify anything outside of Eclipse, sometimes you need to
delete the gen dir and Clean the project which should trigger a
rebuild. That usually works.

Alex

On May 4, 7:42 pm, Leigh McRae  wrote:
> Since you talk about a generated ant file tt sounds like you're project
> was created using the android tool instead of Eclipse.  Is this
> correct?  I spent most of today trying to get a non-eclipse project
> going and had some success up until debugging.  I really wanted to use
> NetBeans but it looks like Eclipse is doing quite a bit under the hood
> for you when it comes to debugging.
>
> If you're using an Ant script for the main build, how are you using
> Eclipse with it?  I wrote something to inc the version number and
> Eclipse really doesn't like the AndroidManifest.xml  file touched.
>
> Leigh
>
> On 5/4/2010 4:36 PM, Alex (PS3 Friends) wrote:
>
>
>
> > My solution was to create two different starter classes with different
> > packages.  One for the paid version and the other for the free
> > version.  Since the package name is used to identify the application
> > in the market.  You can use this to customize the app, by setting
> > properties in the different start classes.  I modified the generated
> > Ant file to switch between the paid/free versions.  I created a task
> > that uses regular expression replacements, identifying sections and
> > replacing the starting class name depending on what I am deploying in
> > the manifest.  You can even modify the XML layouts using this method.
> > Essentially pre-processing prior to compilation.  The R class is the
> > only issue, you need to make sure you include an * import for both
> > packages otherwise it won't work, and you will have to modify code
> > each time.  Also, Eclipse gets upset when you change things underneath
> > it after compiling the R class, you need to delete the generated
> > source directory.  This is the best solution I have come up with so
> > far, it's not great but it works for me and it is scripted.
>
> > Alex
>
> > On May 4, 3:01 pm, Tomáš  Hubálek  wrote:
>
> >> I'm thinking about the same thing.
>
> >> I believe thathttp://code.google.com/p/maven-android-plugin/couldbe
> >> a solution. Maven is very powerful tool for building (we are using it
> >> for JEE projects) so I'm sure that it will support also multiple APKs
> >> from one source code base.
>
> >> But I didn't looked into details yet.
>
> >> Tom
>
> >> On 4 kvě, 20:37, "E.P"  wrote:
>
> >>> Are there any viable approaches for creating multiple .APKs out of a
> >>> single codebase?
>
> >>> The apps may share the same code, but they could have different
> >>> manifest files, different resources, or different external libraries
> >>> (for example in an app with both free and paid versions, the free
> >>> version could have a library for display ads).
>
> >>> Ideally, this would be a single Eclipse project, with a way to specify
> >>> which app to build/debug, and possibly a command line way to batch
> >>> build everything.
>
> >>> --
> >>> 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 
> >>> athttp://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 android-developers@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> android-developers+unsubscr...@googlegroups.com
> >> For more options, vis

[android-developers] Re: Best practices for creating multiple app versions from a single codebase?

2010-05-04 Thread Alex (PS3 Friends)
My solution was to create two different starter classes with different
packages.  One for the paid version and the other for the free
version.  Since the package name is used to identify the application
in the market.  You can use this to customize the app, by setting
properties in the different start classes.  I modified the generated
Ant file to switch between the paid/free versions.  I created a task
that uses regular expression replacements, identifying sections and
replacing the starting class name depending on what I am deploying in
the manifest.  You can even modify the XML layouts using this method.
Essentially pre-processing prior to compilation.  The R class is the
only issue, you need to make sure you include an * import for both
packages otherwise it won't work, and you will have to modify code
each time.  Also, Eclipse gets upset when you change things underneath
it after compiling the R class, you need to delete the generated
source directory.  This is the best solution I have come up with so
far, it's not great but it works for me and it is scripted.

Alex

On May 4, 3:01 pm, Tomáš  Hubálek  wrote:
> I'm thinking about the same thing.
>
> I believe thathttp://code.google.com/p/maven-android-plugin/could be
> a solution. Maven is very powerful tool for building (we are using it
> for JEE projects) so I'm sure that it will support also multiple APKs
> from one source code base.
>
> But I didn't looked into details yet.
>
> Tom
>
> On 4 kvě, 20:37, "E.P"  wrote:
>
>
>
> > Are there any viable approaches for creating multiple .APKs out of a
> > single codebase?
>
> > The apps may share the same code, but they could have different
> > manifest files, different resources, or different external libraries
> > (for example in an app with both free and paid versions, the free
> > version could have a library for display ads).
>
> > Ideally, this would be a single Eclipse project, with a way to specify
> > which app to build/debug, and possibly a command line way to batch
> > build everything.
>
> > --
> > 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 
> > athttp://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 android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://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 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