We actually maintain two separate codebases for our pro and light
products, and take care to port common changes across from one to the
other. They need different package names in the manifest file, in the
layout xml when we refer to custom controls, in the package
declaration at the top of each source file, and in various strings
scattered through the code.

I can't see any way to automate it completely without introducing a
preprocessing step of some kind into the build process.

Richard


On Apr 20, 1:23 pm, Mariano Kamp <mariano.k...@gmail.com> wrote:
> But isn't the real problem that you would need a totally different
> package name to upload it to the Android Market?
>
> On Mon, Apr 20, 2009 at 2:04 PM, MrSnowflake <mrsnowfl...@gmail.com> wrote:
>
> > You can use if-else constructs, as the compiler will leave out any
> > never reached peaces of code.
>
> > Define a var to check against:
> > public static final boolean FREE_VERSION = false;
>
> > and when you want to check:
> > if (FREE_VERSION) {
> >  // This code won't end up in the final binary
> > } else {
> >  // Only this will be there...
> > }
>
> > On Apr 20, 4:47 am, Edward  Falk <ed.f...@gmail.com> wrote:
> >> What is the best way to release two versions of an application?  E.g.
> >> a free version with limited features, and a paid version with the full
> >> feature set.
>
> >> #ifdef would be the ideal way to do this, but Java doesn't support it.
>
> >> Could I do something like:
>
> >>   try {
> >>     import com.foo.myapplication.ExtraFeatures;
> >>   } catch (Exception e) {
> >>     // ignore it, this must be the free version
> >>   }
>
> >> ?
>
> >> I could manage with this kind of construct, although #ifdef really
> >> would be ideal.
>
> >> Anybody?  How have other developers approached this problem?
>
> >>   -ed falk
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to