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?
5
-
I am not sure you understand what you are asking... But in any case. You can turn your android phone to a web server with apache. Just google how. Here is a link as well techrepublic.com/article/…panoskarajohn– panoskarajohn2020-02-16 18:21:16 +00:00Commented Feb 16, 2020 at 18:21
-
3@panoskarajohn I know there are HTTP server apps for android. What I am asking is self-hosting .Net Core API.emert117– emert1172020-02-16 18:42:16 +00:00Commented Feb 16, 2020 at 18:42
-
1@emert117 Did you get any solution to host an API on android?sinsedrix– sinsedrix2021-10-28 08:43:37 +00:00Commented Oct 28, 2021 at 8:43
-
@sinsedrix take a look at hanselman.com/blog/…emert117– emert1172021-10-28 15:38:12 +00:00Commented Oct 28, 2021 at 15:38
-
1@emert117 nothing about hosting on android on this pagesinsedrix– sinsedrix2021-10-29 07:51:57 +00:00Commented Oct 29, 2021 at 7:51
Add a comment
|
1 Answer
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());
}
}