public class CompatibilityHelper
extends Object
Provides helper methods to support newer APIs when running in older runtimes.
Use "wrap" for objects on which you will want to call methods that may not be available in older runtimes.
This helper will use a suitable class depending on the runtime version to implement missing features.
Alternative approaches considered:
1. Wrap instances in a class that extends the implementation of the platform (DefaultInputFile).
The problem with that is the platform implementation class is internal and should not be used,
breaking its encapsulation would be very fragile and therefore dangerous.
2. Instead of wrapping, check the version at each use.
The problem with that is the widespread use of if-else statements,
which would be impossible to keep track of, and very ugly.
Also, the sensor context to get the runtime version is often hard to access.