Monday, April 8, 2013

[android-developers] Re: How to compile APK using different constant

<target name="mybuild" depends="init">
    <echo file="src/${package.dir}/MarketInfo.java" message="package ${package.name};${line.separator}" />
    <echo file="src/${package.dir}/MarketInfo.java" append="true" message="public final class MarketInfo {${line.separator}" />
    <echo file="src/${package.dir}/MarketInfo.java"
          append="true"
          message=" public static String CURRENT_MARKET=&quot;${market}&quot;;${line.separator}" />
    <echo file="src/${package.dir}/MarketInfo.java" append="true" message="}${line.separator}" />
    />
</target>

And in your code


static private final boolean isForGoogleMarket ;
static private final boolean isForOperaMarket;
static private final boolean isForTStoreMarket;
static private final boolean isForAmazonMarket;
static private final boolean isForSamsungMarket;
static private final boolean isForAndroidPitMarket;

    static{
         isForGoogleMarket = MarketInfo.CURRENT_MARKET.contains("Google");
isForOperaMarket = MarketInfo.CURRENT_MARKET.contains("Opera");
isForTStoreMarket=MarketInfo.CURRENT_MARKET.contains("TStore");
isForAmazonMarket=MarketInfo.CURRENT_MARKET.contains("Amazon");
isForSamsungMarket=MarketInfo.CURRENT_MARKET.contains("Samsung");
isForAndroidPitMarket=currentMarket.contains("AndroidPit");
    
    }

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment