Load class based on SDK version
Posted
by Bostjan
on Stack Overflow
See other posts from Stack Overflow
or by Bostjan
Published on 2010-06-07T12:31:48Z
Indexed on
2010/06/07
12:32 UTC
Read the original article
Hit count: 198
Is there any way I can load a class based on what version of the OS the phone is running? For example: I made an app which requires 1.6+ Android. Is there a way for me to load one class or the other based on what OS the phone is running? I'm asking this specifically for contacts. The database was changed from 1.6 to 2.0 and the old version doesn't retrieve contacts on the new OS phone. I'd still like to keep my 1.6 requirement, but at the same time I'd like 2.0+ phones to access the contact part of the app.
So can I make 2 APIs, somehow pack them with the app and decide on the fly which I choose to import?
© Stack Overflow or respective owner