I am pretty sure this question has been asked before, but I could not find it anywhere, so please don't bite.
I am writing an android app, that needs to communicate with nearby devices and I want to used WifiDirect API if two devices that have it happen to be nearby.
But if that's not the case application can still work and it will use other less effective ways to communicate between participating devices (like Wifi Access Point sharing).
I also want this app to be possible to run on older devices like android 2.2 which does not have WifiDirect API at all (>=4.0 I think).
So is there anyway to make my app optionally use new API, but not necessarily in case of older phones?