Preprocess AndroidManifest.xml ?

by Kevin TeslaCoil Software » Thu, 31 Mar 2011 03:23:04 GMT

Sponsored Links
 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:

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:

    <uses-permission android:name="" /
android:name="android.permission.READ_PHONE_STATE" />

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
(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?



Re: Preprocess AndroidManifest.xml ?

by joebowbeer » Fri, 01 Apr 2011 06:53:32 GMT

 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:22pm, Kevin TeslaCoil Software <>


Sponsored Links

Other Threads

1. Question about 'hasFocus' field in HierarchyViewer

hasFocus is different from isFocused. hasFocus == true means that the
View or one of his descendants is focused. If you look closely,
there's a chain of hasFocused Views till you reach the View that

The new HiearchyViewer that comes with Cupcake makes that more obvious
by coloring the chain of "focused" views.

Romain Guy
Android framework engineer

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


2. FILL_AND_STROKE not working for Rectangle

When I set Paint.Style to FILL_AND_STROKE and  drawRect, I got the same
result as STROKE. FILL worked as expected in drawRect.

FILL_AND_STROKE worked ok under drawOval()

Has anyone experienced same problem?
Kind Regards,


3. When will copyrighted material be stamped out of the market?

4. Installing the ADT plugin for Eclipse with only the command line.

5. Question about 'hasFocus' field in HierarchyViewer

6. override errors when migrating development computers

7. How to troubleshoot a Stackoverflow error in android ViewRoot?