Preprocessing is doable. The downside is that preprocessing is not supported directly by the Eclipse ADT. (Btw, I like the NetBeans preprocessor and its support for configurations, and it would be great to have first-class Android support in NetBeans as well.)
But I digress. An option that is directly supported in Eclipse is Library Projects. In theory, you can move all of your code and resources to a shared library project. Then create two client projects: one for Android Market and one for Amazon Appstore. These projects would use the library project, but add their own custom AndroidManifest.xml. On Mar 30, 12:22 pm, Kevin TeslaCoil Software <[email protected]> wrote: > With all these Markets, apks are starting to get more complicated. I'm > taking the approach of a different APK for different Markets. > There's some permissions I need in some cases and not in others. Like: > com.android.vending.CHECK_LICENSE > > It doesn't hurt anything to have it on the Amazon store (And they > haven't rejected for it), but it's unnecessary. > I also have a direct-purchase option and I want to use, > READ_PHONE_STATE. I don't want to include this permission when it's > unnecessary for the Google Market or Amazon Appstore. > > The idea in my head is having an AndroidManifest.xml like: > > <!-- > #ifdef USE_GOOGLE_MARKET > --> > <uses-permission android:name="com.android.vending.CHECK_LICENSE" / > > <!-- > #endif > --> > <!-- > #ifdef USE_DIRECT_LICENSING > --> > <uses-permission > android:name="android.permission.READ_PHONE_STATE" /> > <!-- > #endif > --> > > Then run AndroidManifest.xml through cpp. This would mean I could > compile debug builds with Eclipse easily, and they'd just have all > permissions. But when using Ant I could limit it to just one Market's > permissions. > (I'm handling actual java code with a static final int MARKET_TYPE > deal that gets set by ant) > > Anyone know of anything like this that already exists? Anyone know why > this is a horrible idea and I shouldn't pursue it? > > -Kevin -- 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

