The above-mentioned link should give you all you need to produce a
multi-version app.  Basically what it's saying is that you refer to
any version-specific API's using java reflection.  So there is no
compile-time dependency with the later API's, and the code will only
load these classes at runtime if the version check is satisfied.  That
is, if the environment in which the application is running supports
those classes/apis.

This is only relevant of course if you are indeed using later APIs in
your app (which I assume you are).

The other solution would be to abstract away the version specific
parts into a separate project.  So you would have your core project
referencing base classes (not interfaces, as they are too costly).
Then you have specific implementations in a referenced project.  You
then just build a JAR file for the particular referenced project based
on the API version and package it with your app.  This is a standard
"dependency injection" approach and may (or may not) be superior to a
reflection-based approach depending on the circumstances.

What is it about this you don't understand exactly?

On Sep 9, 3:19 pm, cindy <[email protected]> wrote:
> Don't get it. Anyone know the solution
>
> On Sep 8, 10:22 am, TreKing <[email protected]> wrote:
>
>
>
> > On Wed, Sep 8, 2010 at 12:05 PM, cindy <[email protected]> wrote:
> > > How could I do it?
>
> >http://android-developers.blogspot.com/2009/04/backward-compatibility...
>
> > --------------------------------------------------------------------------- 
> > ----------------------
> > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > transit tracking app for Android-powered devices

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