我可以运行在移动平台上的HTTP服务器?服务器、平台上、HTTP

2023-09-05 11:04:22 作者:且行且珍惜

我建立一个web应用程序不能被放入应用程序商店(安全原因)。在Web应用程序需要访问的数据超过在localStorage的或其他脱机存储手段进行(比方说高达1GB的数据)。

I am building a webapp that cannot be put into the app store (security reasons). The webapp needs access to more data than can be held in localStorage or other offline-storage means (let's say up to 1GB of data).

我的解决方案的想法是code了一个HTTP服务器,用于Android和iOS,然后GET / POST数据与AJAX,所以我可以有机会获得该设备的内部存储。

My idea of a solution is to code up an HTTP server for Android and iOS, and then get/post data with AJAX so I can have access to the device's internal storage.

我的问题是,

这个问题能在iOS和Android做了什么?

Can this be done on iOS and Android?

通过'可以',我的意思是无论在技术上还是(有API访问所需的组件,并且可以在后台始终运行),法律(是它用在App Store和Android的服务条款相一致市场)。

By 'Can', I mean both technically (is there API access to the required components, and can it be always running in the background) and legally (is it consistent with the terms of service of both the App Store and Android Marketplace).

我不知道很多关于要么平台和能力,但我可以计算出来,如果​​我有信心,这是可能的。

I don't know much about either platform and the capabilities, but I could figure it out if I was confident that it is possible.

这样做的原因是,使大量数据可编所有的时间到web应用程序,而不管无线的presence或小区发射塔。

The reason for this is so that large amounts of data can be made available all the time to a webapp, regardless of the presence of wifi or a cell-tower.

推荐答案

Android的例子:创建HTTP服务器的Andr​​oid 在iOS的例子: iPhone HTTP服务器 Android examples: Create http server android. iOS examples: iPhone HTTP Server.

对于一个完整的应用程序,使用一个HTTP服务器,请 Websharing 在Android上。

For a full app that uses an http server, check out Websharing on Android.