Xamarin Portable

Asked

Viewed 70 times

0

It is possible in Xamarin to have a Xamarin.Android and Xamarion.IOS project and to have a class that accesses the Sqlite and reuse it in these two projects?

How can we call it?

Does anyone have an example?

  • Yes, it is possible, I think this is answered in some of these questions or as a whole: https://answall.com/q/192117/101, https://answall.com/q/38099/101, https://answall.com/q/186582/101, https://answall.com/q/127567/101, https://answall.com/q/128446/101

1 answer

0

Yes it is possible.

Today there are two ways to share code in Xamarin.

Portable Projects(to be replaced by . NET Standard) and Shared (SAP).

For your scenario, access to Sqlite, iOS and Android Voce projects will need to use the concepts, Partial Class for SAP type projects or Dependency injection for portable projects, this is your preference, it is necessary to carry out small implementations for each platform.

Why it is necessary to have implementations for each platform?

Each platform stores the Sqlite file in different Paths, being necessary its implementation in each platform, therefore using these standards we can share all the common code and implement in each platform what is specific.

From a researcher who will see implementations and use of these scenarios, even has a Xamarin marathon that talks about these topics Sqlite and code shares via Xamarin.

  • Where is this marathon?

  • @Biabaldasso, follow the link with information. http://ticapacitacion.com/curso/xamarinpt/

  • "It will be replaced by . NET Standard" - when it will occur?

Browser other questions tagged

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