我只找到了使用 Android 使用 Web 服务的教程。 但我想做的是在 Android 手机上托管 Web 服务,并使用 .Net 应用程序使用此 Web 服务。
有人知道好的教程或类似的东西吗?
最佳答案
你可以使用 i-jetty ,Android 的网络服务器。
还有一些资源可以解决您的问题:
- RESTful Web Services Implementations in Mobile Devices
- Android - Create RESTful WebService - Host it on mobile
然而,根据this answer :
...mobile networks (wifi and 3g) mostly use NAT, which prevents inbound connections. This makes mobile devices inaccessible from the internet (inbound) while they can still initiate outbound connections. For this reason mobile devices mostly do not host servers.
它还可能耗尽您设备的电池。
希望这能澄清您的疑虑。
关于android - 在 Android 上托管网络服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23655250/