From: Sascha H. <sa...@xm...> - 2010-06-23 14:12:19
|
On Wed, Jun 23, 2010 at 12:11 PM, Panayotis Katsaloulis < pan...@pa...> wrote: > > > So, your opinion is XMLVM to be updated to the latest API, in any > case, and let the programmer deal with multiple versions. > That's the quickest (and easiest?) solution :) > I am thinking though if there is a safer way to do it. > I am completely ignorant at this point, but is there any java compiler > option to check if the code is older than a specified version? > How this problem is dealt with java libraries? What you describe is exactly what is happening in Android. You might want to use a new feature that is unavailable for older devices, but you might be able to run the program with an older API or without the feature. In these case it's recommended use reflection. So you check at runtime, if a certain class or method is present. You then provide a reasonable fallback for devices running an older version. // Sascha |