Using Xamarin.Android and Xamarin.iOS, I need to now the current OS in a shared code section. Be it an enum, an int or a string, it doesn\'t matter.
I tried this:
Using reflection, try to retrieve the value of the Monotouch.Version property (and the equivalent for MfA: Android.OS.Build.VERSION). One of the calls will fail, the other should succeed; that's why you have to use reflection. That's for a real runtime check.
But as your app is compiled twice, you can fix that value at compile time.
#if MONOTOUCH
var platform = "iOS"
#else
var platform = "Android"
#endif