Surprised this wasn't mentioned before but a library project would be
a good way of doing this. So pro and free versions implement the
library project, and you could have the pro version extend classes in
your library, or even have the free version extend and override
methods to ask to update/change names etc.

I've just moved my main project over to doing this and it's saving me
so much time already!

See: 
http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject

On Feb 4, 12:43 pm, Régis <[email protected]> wrote:
> Yes, I somehow also miss precompilation in Java ;-)
>
> I suppose you could simply define a constant somewhere in your code like
> {{boolean Constant.FULLVERSION}} and then use
> if(Constant.FULLVERSION) {
>    // interesting code}
>
> else {
>    throw new UnimlementedException("Please buy the full version");
>
> }
>
> (if you are new to java, rest calm: the java compiler will *not* produce
> bytecode for such dead code)
>
> You can then easily publish two versions of your application, simply by
> changing the value of the constant and recompiling.
>
> For multiple version, that could be an enumeration.
>
> An alternative approach is to have the free version contain everything, with
> a method checking for a key instead of the constant, and then to sell an
> "unlock application" that simply provides a valid license.
>
> Hope this helps
> --
> Régis

-- 
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

Reply via email to