Question

I'm done reading the Xamarin guide, but I didn't found a File -> New Solution -> etc... kind of instruction on setting up a Cross-Platform project. All it says in http://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/part_3_-_setting_up_a_xamarin_cross_platform_solution/ is to start with a blank solution.

So I'm guessing the way to go is control+click the solution -> Add -> Add New Project and then select Android/iOS. I'm not sure if this is ok, since the screenshots on the website shows android projects with an android icon, and the iOS project shows an iOS icon.

Also I'm confused about the core library part. Am I suppose to create 1 Project for the core, or 3 Projects that share the same files (via linking or cloning)? Here's a picture of the projects in the guide documentation, I suppose they all belong to the same solution, but not sure if the 3 core project should exist or only one that is going to be consumed by the platform-specific projects. Also when creating a new core Project which one should I choose (C# -> Empty or C# -> Library etc...)

Thanks in advance, I'm new to Xamarin, i really like it but I'm kinda lost.

Was it helpful?

Solution

You start with a blank solution. Then you right click the solution and add a new project, for instance MyApp_iOS and select an iOS template. Next you repeat this for Android and all other platforms you want to support.

You will have to worry about your code sharing strategy. If you want to share one core library, add another project and select "Shared library (PCL)" (http://docs.xamarin.com/guides/cross-platform/application_fundamentals/pcl/) as project type. This one can be referenced from all platforms.

Alternatively if you want to use file linking (http://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/), add a standard .NET library and then create a subfolder on all of your platform projects and add existing files from the library. In the dialog choose to "link" the files and do not copy or move them.

I recommend you check out the many available samples like the field service app to get a understanding: http://xamarin.com/prebuilt/fieldservice

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top