The Java language specifications do not include a preprocessor syntax, so we won't. You can use other languages that compile to .class or .dex though.
On Thu, May 20, 2010 at 7:12 AM, Leigh McRae <[email protected]> wrote: > > > On 5/19/2010 11:49 PM, Xavier Ducrohet wrote: >> >> Making petition to make us do something is an absolute waste of time. >> >> Filing reasonable feature request (http://b.android.com) with a >> concise explanation why the feature is needed has a much better chance >> of success. >> >> Contributing is even better! See the new http://source.android.com and >> be aware that the dev tools development has moved 100% to the open, so >> you can see real time what we're doing. >> >> On Wed, May 19, 2010 at 2:41 PM, [email protected] >> <[email protected]> wrote: >> >>> >>> I think Google should make an effort to improve the android developer >>> tools. Here I write some things I think need to take in account: >>> >>> - Fix problems of communication between IDE and emulators >>> >> >> Yes this is annoying. >> >> >>> >>> - Add support to conditional compilation #IF,#ELSE,#ENDIF (I wan't to >>> have 2 versions in the same proyect ... beta and non beta, free and >>> paid, etc.) >>> >> >> Free and paid apps shouldn't be done by a preprocessor for several >> reasons: You want to change the content of XML file. an XML >> pre-processor is going to be harder. Also you probably won't have the >> same files at all and a pre-processor won't really let you >> exclude/include whole files. >> >> We will introduce a new build mechanism that will allow you to easily >> share code and resources across 2+ application projects that will be >> much better at handling this case. >> >> As for the beta vs. final version, yeah, as someone else said, this >> makes no sense. >> >> > > First the OP didn't talk about using a preprocessor for xml. I would agree > that that would be odd and there are better tools for that. Still a > preprocessor could be used to conditionally include a resource by id. How > about I give you some concrete examples and you can help me see the light? > > ---------------------------------------- > Example 1 > ---------------------------------------- > //#if BETA > if ( hasBetaExpired() ) > System.exit( 0 ) > //#endif > ---------------------------------------- > Example 2 > ---------------------------------------- > public final class Assert > { > public static final void RIP( final String msg ) > { > //#if BETA > sendReport( msg ); > //#endif > System.exit( 0 ); > } > } > ---------------------------------------- > Example 3 > ---------------------------------------- > public class Debug > { > void Println( String msg ) > { > //#if !RELEASE > Log.d( TAG, msg ); > //#endif > } > } > ---------------------------------------- > Example 4 > ---------------------------------------- > //#if PLATFORM_BLACKBERRY //@ omega = > (float)MathUtilities.acos( cosom ); > //#else omega = (float)java.lang.Math.acos( cosom ); > //#endif ---------------------------------------- > Example 5 > ---------------------------------------- > public static final float VecToHeading( float x, float y ) > { > //#if PLATFORM_BLACKBERRY > //@ float fAngle = ((float)Fixed32.atand2( (int)(x * 65536.0f), > (int)(y * 65536.0f) )) / 65536.0f; > //#else > float fAngle = ((float)Math.atan2( x, y )) * > 57.295779513082320876798154814105f; > //#endif > if ( fAngle< 0.0f ) > return fAngle + 360.0f; > > return fAngle; > } > > > -- > Leigh McRae > www.lonedwarfgames.com > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

