3

I hope someone can help me with this one.

I'm have been developing for the iPhone for a long time, and I'm used to set a preprocessor macro so I can use #ifdef in code to do different things with different targets.

How do I do something like that with Android? As far as I know Java does not support preprocessor macros. How can I have a different behavior with different run configurations in Eclipse?

devnull
  • 118,548
  • 33
  • 236
  • 227
Peter
  • 1,495
  • 1
  • 14
  • 21
  • Had a similar question before, this post answered it for me: http://stackoverflow.com/questions/1813853/ifdef-ifndef-in-java – mikhon Jan 24 '11 at 22:40
  • Thank you! I have a server with two different urls for testing and produktion. Ended up making a static final boolean test and doing something like this: public static final serverUrl = test ? testUrl.com : produktionUrl.com; – Peter Jan 24 '11 at 23:07

0 Answers0