3

I'd like to make some changes in my code according to some Marketing requires. I thing that the best solution is using preprocessing, like in J2ME. How can I do it? Is there any tool for this task? Thanks, Eyal.

eyal
  • 2,379
  • 7
  • 40
  • 54

3 Answers3

5

You can find more details under the below link:

http://groups.google.com/group/android-developers/browse_thread/thread/0daee1d93d1f21b3?pli=1

Basically it is said that Android doesn't support preprocessing because Java doesn't support it.

However there are ways to imitate the behaviour of preprocessors using System Properties in Java. And there is already a discussion on it:

#ifdef #ifndef in Java

Community
  • 1
  • 1
hnviet
  • 1,747
  • 1
  • 18
  • 22
  • 1
    saying that android doesn't support preprocessing is like saying that windows doesn't support preprocessors. and for sure it is necessary if you want flexibility - and not manually preprocess out debug statements and such. that thread is a good example of why that newsgroup is.. well it's just better to browse stack. it starts out with someone asking for preprocessor for netbeans and degrades instantly as someone says that you can't. even though the tools themselves do preprocessing kind of tasks. – Lassi Kinnunen May 04 '16 at 13:14
1

There are number of preprocessors for Java, I use my own https://github.com/raydac/java-comment-preprocessor it supports Maven, ANT and Gradle The Wiki project page where described the process can be found here

Igor Maznitsa
  • 833
  • 7
  • 12
0

While this was originally designed for J2ME, the preprocessor itself is completely generic. (I wrote it about 6 years ago, and it ended up in Eclipse MTJ). http://antenna.sourceforge.net/wtkpreprocess.php

Omry Yadan
  • 31,280
  • 18
  • 64
  • 87