My API doesn't use any database or any authentication. API supports just basic functions. Is there any way to host a .Net Core API on Android?
Assume your Android app is written in .NET MAUI, you just need to inject the initialization of ASP.NET Core in App.xaml.cs,
namespace MauiApp;
public partial class App : Application
{
public App(WebAppHost webAppHost)
{
InitializeComponent();
MainPage = new AppShell();
// Start web app server.
_ = Task.Run(() => webAppHost.StartAsync());
}
}
The full sample can be found on GitHub.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With