I'm creating a navigation midlet. It gets positions thru bluetooth and an external GPS receiver. Now i want to implement JSR-179 Location API to use the built in GPS unit of some new phones. This means if the phone supports JSR-179 then the build in GPS should be used, if not BT discovery will start.

Is it possible to do this in one single midlet? I've made some quick tests and my midlet didn't start at all on non JSR-179 phones, saying "No Class Def Found Error" and references some JSR-179 classes. Is it possible to check at runtime if the API is supported and avoid this error somehow? Or do I have to create two different midlets for the two different type of phones?

Thanks a lot!