[mono-android] Conditional compilation

Greg Shackles gshackles at gmail.com
Sat Feb 11 14:32:23 UTC 2012


MonoTouch doesn't provide any symbols automatically right now (see
http://bugzilla.xamarin.com/show_bug.cgi?id=2409). You could easily add one
yourself in your project's build configuration, though.

Mono for Android does provide various symbols out of the box that you can
use. It defines __ANDROID__ for everything, and then also provides API
level-specific ones. For example, if your app supports API level 8+, it
will define __ANDROID_8__, __ANDROID_7__, etc.

On Sat, Feb 11, 2012 at 9:23 AM, Paul Johnson
<paul at all-the-johnsons.co.uk>wrote:

> Hi,
>
> Are there an internal #def within monotouch and monodroid that can be used
> for conditional compilation. What I'm after is to be able to do something
> like this (very simple example)
>
> using System;
> #ifdef MONOTOUCH
> using System.Drawing;
> using MonoTouch.Foundation;
> using MonoTouch.UIKit;
> #else
> using Android.App;
> using Android.Content;
> using Android.Runtime;
> using Android.Views;
> using Android.Widget;
> using Android.OS;
> #endif
>
> Thanks
>
> Paul
> ______________________________**_________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/**mailman/listinfo/monodroid<http://lists.ximian.com/mailman/listinfo/monodroid>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20120211/0e03c1cd/attachment.html>


More information about the Monodroid mailing list