Akhter
Akhter

Reputation: 43

Xamarin Cross Platform Background services for Android & Windows Embedded

How to develop a cross platform Service in Xamarin which will run on Android && Windows Embedded?

If not feasible, what could be an alternative, where I can reuse most of my code.

Upvotes: 0

Views: 615

Answers (1)

Elvis Xia - MSFT
Elvis Xia - MSFT

Reputation: 10831

How to develop a cross platform Service in Xamarin which will run on Android && Windows Embedded?

Xamarin.Forms leverages PCL as the cross-platform codes container and the codes inside was built into binary codes and consumed by your runtime environment. But Service is really something platform dependent. It is not possible to make it cross-platform.

If not feasible, what could be an alternative, where I can reuse most of my code.

Well, it depends on your service codes. I believe there are some part of codes of your service that can be made cross-platform:

  1. Models: If your service leverage certain model classes. It is OK to place these classes in PCL/Shared Project.
  2. Helpers: Helper classes is also a good option to be placed in PCL/Shared Project.

Notes: If you want to reuse some functions, it is better to wrap the function with a helper class and make it cross-platform.

Upvotes: 1

Related Questions