What would be the best practice to share busines logic c# code between MonoTouch and Mono For Android projects?
Edited:
Initially, my question was about the physical file sharing:
- What do you propose to use: network file sharing or some code
version control (git, svn)? In my case I am using two workstations –
Mac (MonoDevelop with MonoTouch) and PC (Visual Studio with
MonoDroid). - What about Solution/Project folder structure? In
“Blog Post: Xamarin Mobile World Congress 2012 Unofficial
Conference App Released!” example structure is quite confusing:
several solutions in one folder and then different platform projects in one
subfolder with different folder and project names. It can not be accomplished nativly
with IDE. Are they editing content of solution files and folder names manualy
outside of IDE environment? - And for projects of common code what kind of profile (template) to
use? Monotouch has several: Empty Project, MonoTouch Library
Project and MonoTouch Binding Projects? In Android i supose –
Android class library?
This is a very general question, but here are a few resources that may help you get started:
Edit (to answer your new questions)
The idea behind linking files across projects is that there is only one actual copy of the file, rather than having to manage multiple copies and keep them in sync yourself. The file will actually exist in just one project and be linked into the others, but when the projects are compiled it treats the file as if it were actually there.
I can’t speak to exactly how they created their folder structure, but I know there have been many cases where I would manually edit project or solution files to get the folder structure I want, because there was no way to get what I wanted through the IDE alone. This really boils down to personal preference on how you want your folders to be structured.
In the end, what you need is a class library project for every platform you want to target. When going with the linked file approach, it’s totally up to you where you put the physical files. One approach I use often is to actually create a standard .NET 4.0 class library, put the files in there, and then link them into my Mono for Android and MonoTouch class libraries. If all you care about is targeting iOS and Android, that may be more trouble than it’s worth, and you can just let the files live in one project and link them into the other.