[mono-android] dynamically target Kindle Fire from same project

Jonathan Pryor jonp at xamarin.com
Sun Jan 15 16:33:14 UTC 2012


On Jan 14, 2012, at 12:11 PM, Gerry High wrote:
> I'd like my monodroid app to be able to run on the Kindle Fire and as such I need to be able to turn off Google maps.  Short of creating a new project is there a way to tie the android manifest settings (e.g. ACCESS_COURSE_LOCATION, ACCESS_FINE_LOCATION) to a build configuration?

_Probably_. This is untested, but you could presumably edit your Project.csproj and add a Condition attribute to the the <AndroidManifest/> element:

	<PropertyGroup>
		<!-- ... -->
		<AndroidManifest Condition="'$(TargetKindle)'== 'True'">KindleManifest.xml</AndroidManifest>
		<AndroidManifest Condition="'$(TargetKindle)'== ''">AndroidManifest.xml</AndroidManifest>
	</PropertyGroup>

Then you could set the TargetKindle property when building your project to select the KindleManifest.xml file:

	msbuild /t:SignAndroidPackage /p:TargetKindle=True Project.csproj ...

However, I have no idea what doing this will do to IDE support for editing the AndroidManifest.xml file; it may break.

(The "silly" MSBuild ideas that come to mind...)

 - Jon



More information about the Monodroid mailing list