Even if you're developing cross platform code, when the time to compile it comes, you need to target a platform. Determining it is then a matter of checking precompiler definitions.
Most compiler will define some platform while compiling, if not, you can do so by yourself when configuring your project.
For example, Xcode will define __APPLE__
and TARGET_OS_IPHONE
and TARGET_OS_MAC
when compiling respectively iOS and Mac projects.
For Android, __ANDROID__
should be defined by the toolchain however I've seen multiple mk files add explicit platform flags like so:
LOCAL_CFLAGS := -DANDROID $(LOCAL_CFLAGS)
It is then a matter of using precompilation conditions:
#ifdef __APPLE__
#if TARGET_OS_IPHONE
// Configure for iPhone
#endif
#endif
#ifdef ANDROID
// Configure for Android
#endif
For determining the version, there isn't really anyway to do that without calling Native API. Fortunately, there is pattern you can use to factor out the specific implementation and put a generic interface in front of this code.
As far as IDE, this is largely a matter of choice and availability. Most popular ones are Xcode for iOS and Eclipse for Android but it is possible to use other as well.