Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm investigating Xamarin solution for my project.

Project requirements are:

  • IOS app,

  • Android app,

  • MacOS app,

  • Windows 7,8,10 app.

I already build test solution based on MvvmCross and it works fine.

My question is, how can I build whitelabel apps for all platforms that will be based on my test solution? In those apps I will change only resources, such as Strings, icons, fonts...and so on, but logic, views and UI will be the same.

Is there any way to do it like gradle in android (build variants) ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
481 views
Welcome To Ask or Share your Answers For Others

1 Answer

MSBuild has a lot of features and can certainly achieve something similar to what gradle has with build variants. However, it is complicated to dive into that stuff if you don't have a background with MSBuild.

I think this might be the easier approach (and what I would do):

  • Use projects to organize everything
  • Keep all your cross-platform code in a Shared project (or PCL)
  • Keep all Windows, iOS, Android-specific code in a Shared project for each platform
  • Make a startup project for each flavor/platform of your app, referencing the shared projects. If you wish, include preprocessor defines for each flavor of your app.

In the startup projects you can include different string resources, images, etc. Also look into how to use "file-linking" in Visual Studio/Xamarin Studio, as it will help you out of tight spots here--especially if the different flavors of your app vary in different ways.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...