[mono-android] dynamically target Kindle Fire from same project
Gerry High
ghigh at hightg.com
Mon Jan 16 13:52:45 UTC 2012
This is the route I'm going--to have 2 projects within the same solution. One thing I've run into is that the IDE doesn't seem like it is smart if you link your layout files in that it is not updating the Resource.designer.cs with the IDs, etc. from the linked layout files.
Is this a know issue or is there some workaround?
Thanks,
Gerry
On Jan 15, 2012, at 10:51 AM, Jonathan Pryor wrote:
> Really, the easier/saner thing to do is just have separate projects for Kindle vs. non-Kindle builds, and Link the source files between the separate projects. There's less hand-editing of .csproj files this way, and it'll be easier to build your packages from within the IDE.
>
> - Jon
>
> On Jan 15, 2012, at 11:43 AM, Jonathan Pobst wrote:
>
>> We also now support declaring permission in code, so you can use defines:
>>
>> #if !KINDLE
>> [assembly: UsesPermission (Android.Manifest.Permission.Internet)]
>> #endif
>>
>> But I am guessing the actual issue you are hitting is that referencing the GoogleMaps assembly automatically adds the <uses-library> to your manifest.
>>
>> So you would need to use conditions like JonP suggests, but on the <Reference> to the GoogleMaps.dll instead, and not reference the library on Kindle builds.
>>
>> Jonathan
>>
>>
>> On 1/15/2012 10:33 AM, Jonathan Pryor wrote:
>>> 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
>>>
>>> _______________________________________________
>>> Monodroid mailing list
>>> Monodroid at lists.ximian.com
>>>
>>> UNSUBSCRIBE INFORMATION:
>>> http://lists.ximian.com/mailman/listinfo/monodroid
>>>
>>>
>>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20120116/f3e28586/attachment.html>
More information about the Monodroid
mailing list