Xamarin.Forms Portable or Xamarin.Forms Shared

Asked

Viewed 488 times

7

What is the difference between a Xamarin.Forms Portable or Xamarin.Forms Shared project?

1 answer

5


Portable is applied in a limited version (subset) of framework that can run on all platforms. Any code has to be written considering these limitations and if you need to do some specialization, this must occur with dependency injection or some technique that gives the same result (even simple decisions with if). It’s something more dynamic.

Portable Class Library

Shared uses code developed for all platforms and specializations are decided through conditional compilation #ifdef. That is, the source code may be unique, but a different version will be generated for each platform. It is something more static.

Shared Project

This doesn’t make much sense anymore, it has better solutions.

  • what are the advantages and disadvantages of each approach?

  • In short I think it is already implicit in the answer, Portable is faster to develop, but it doesn’t get as good. In detail it would not fit here, it would have to be a new question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.