I’m not sure if there is an Android way to do this or if this is just a general Java question. What is the best design for a feature detection mechanism? I want to be able to ask if the runtime environment supports feature foo (this may be determined at compile time as well, so not just runtime stuff).
UPDATE
I’m thinking of using the following (naive?) approach:
public enum Feautures {
GPS, DockToKeyboard;
public boolean isSupported() {
//switch statement
}
}
or