[mono-android] Sharing code between iOS, Android and Windows Phone

Miljenko Cvjetko mcvjetko at holisticware.net
Sun Nov 13 16:46:04 EST 2011


Hi

On 2011.11.08 01:01, Steven Pack wrote:
> Thanks all. Sharing the code, not the binary. Got it. Makes sense.
Here is multi project template for

  * platofrms - WP7, Mono4Android, RIA SL, WP, WF, asp.net
  * layers only 2 BL + PL

http://www.holisticware.net/HolisticWare/Know-How/Development/multitargeting-portability-interoperability/visual-studio-solutions.aspx

Naming is Company.Project, no wizard for renaming. We'll go for batch script
renaming...
Right now our priority is to add MonoTouch projects and scripts for changing
guids on MT projects...

Caveats:

  * when opening solution one extra level dir is created. Dunno why...
    but searching!!
  * paths might be too long for %userprofile%\Documents\vs2010\blablabla

our is dropped in:
%userprofile%\Documents\Visual Studio 
2010\Templates\ProjectTemplates\Visual C#

and we solve problem with long paths by keeping source on disk close to 
root!

d:\src

regards

mel


>
> Thanks for the detailed samples and write-ups. Very helpful.
>
> Steve
>
> From: Miljenko Cvjetko <mcvjetko at holisticware.net 
> <mailto:mcvjetko at holisticware.net>>
> Organization: HolisticWare
> Reply-To: <mcvjetko at holisticware.net <mailto:mcvjetko at holisticware.net>>
> Date: Tue, 08 Nov 2011 00:01:21 +0100
> To: Discussions related to Mono for Android 
> <monodroid at lists.ximian.com <mailto:monodroid at lists.ximian.com>>
> Cc: Steven Pack <steven_john_pack at yahoo.com.au 
> <mailto:steven_john_pack at yahoo.com.au>>
> Subject: Re: [mono-android] Sharing code between iOS, Android and 
> Windows Phone
>
> Hi
>
> On 2011.11.07 08:16, Steven Pack wrote:
>> Hi All,
>>
>> I'm using Xamarin, specifically because I'd like to share as much 
>> code as possible between the platforms. I've noticed I can only 
>> reference library projects that target "Mono for Android x.x". I'd 
>> hoped to be able to simply create a Mono class library and only use 
>> the classes supported by MonoDroid or MonoTouch and reference said 
>> project from either platform.
> Our team does it with single solution and projects for each platform 
> and shares on source
> code level with links to source files (cs, xaml etc) not IL (by 
> referencing assemblies).
>
> Architectural only 2 layers Business Logic BL and Presentation Layer 
> PL with
> assemblies per platform... Controlers and ViewModels in MVC and MVVM 
> can be
> moved to those assemblies...
>
>   * Business logic (BL) per platform linked with Project Linker.
>       o Starting with WP7x project as "smallest common denominator -
>         subset"
>         (because of various restrictions - Android Mono4Android and iOS
>         MonoTouch are still in front).
>       o all projects have WP7 project as "linked source project"
>         (Project Linker terminology)
>         meaning code in them/their folders is just a link to cs file
>         in WP7x prj
>   * Presentation Layer PL dlls (User Control library project types)
>       o our team uses them for reusing
>           + some UI code if it can be shared across projects
>           + xaml controls (write up is on the way).
>       o MonoDroid - does not apply cos layouts from other
>         assemblies cannot be used - yet
>   * Presentation Layer EXEs - main entry points - per platform
>   * Unit testing Projects
>       o if Windows Forms BL assembly reuses bunch of WP7x code and adds
>         some more, then NUnit test for WF or WPF project will cover a
>         lot from
>         WP7x and You are not stuck with WP7 based UnitTesting in emulator
>
> These below are our working notes on recommendation for solution and 
> project
> structure and naming...
> Team is still working on it and it is far from stable, but You could 
> get the idea...
> http://www.holisticware.net/HolisticWare/Know-How/Development/Visual-Studio-Project-Structure.aspx
> Numerical stuff is just to have projects ordered in Solution Explorer, 
> because with growing
> number of platforms and more architectural layers.
>
> Project Linker exclusion
> http://www.holisticware.net/HolisticWare/Know-How/Development/visual-studio-project-linker.aspx
>
> ... and we are moving our site to new version, so bunch of texts is 
> waiting to be published...
>
> HTH
>
> regards
>
> mel
>
>
>>
>> What am I missing here? How does one go about sharing code?
>>
>> Steve
>>
>>
>> _______________________________________________
>> Monodroid mailing list
>> Monodroid at lists.ximian.com
>>
>> UNSUBSCRIBE INFORMATION:
>> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
> -- 
> Miljenko Cvjetko dipl.ing. ET
> 	Direktor/CEO
> 	Projektant rješenja/Solution Architect	
> 	Razvojni programer/Senior developer
> 	Voditelj projekta/Project Manager
>
> IX južna obala 13
> Kajzerica Zagreb
> T: 385 1 7775555
> M: 385 91 557 447 3
> F: 385 1 7779556
> e:mcvjetko at holisticware.net
> w:http://www.holisticware.net


-- 
Miljenko Cvjetko dipl.ing. ET
	Direktor/CEO
	Projektant rješenja/Solution Architect	
	Razvojni programer/Senior developer
	Voditelj projekta/Project Manager

IX južna obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvjetko at holisticware.net
w: http://www.holisticware.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111113/98ce2fd6/attachment-0001.html 


More information about the Monodroid mailing list