简体   繁体   中英

A web application and Xamarin.Android app communicating to a Service/API

I'm working on an .Net application in which a user can either use a Xamarin Android app or a web application to use the system. I would like to put all the business logic at one place and both the applications shall use it.

Considering that I have "NO" experience in Web APIs or Services, how shall I design my application?

However, I'm ready to learn both (Web APIs or Services) if required for the implementation.

Considering that I have "NO" experience in Web APIs or Services, how shall I design my application?

The question should rather be, do you need to call some external services, or can you do everything locally on the phones? If some external services are required, you need web API call from your different platforms. The business logic goes in your API.

If everything can be done locally, you can just share your client side code.

As you probably know, Xamarin app's usually follow a MVVM architecture. It does not mean the business logic must be in the sharing ViewModels (I actually wrote a blog post about that if it you want more information).

The business logic must be in the domain models, and possibly some services.

Thus, in the end you can share the c# code of your domain models and business services between your xamarin app and your web application.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM