Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I run an HTTP server on a mobile platform?

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).

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.

My question is,

Can this be done on iOS and 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.

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.

like image 761
beatgammit Avatar asked Sep 10 '11 23:09

beatgammit


People also ask

Can we run server on mobile?

From the office of “We do this because we can” comes the ability to run a web server on an Android device. But this isn't just any old web server–this is one powered by Apache. The server in question is HTTP Server powered by Apache and it can be found on the Google Play Store.

Can I host website from mobile?

Install the Web ServerInstall and launch KSWEB on your Android device. The app only has a six-day free trial, after which it costs $2.99. There are a number of other web server apps, including Bit Web ($2.39) and Servers Ultimate, but we chose KSWEB for this tutorial because it is one of the simpler options.

What is HTTP server in Android?

GitHub - piotrpolak/android-http-server: A complete zero-dependency implementation of a web server and a servlet container in Java with a sample Android application. Product.


1 Answers

Yes

  • Android examples: How to create a HTTP server in Android?.
  • iOS examples: iPhone HTTP Server.

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

like image 86
John Carter Avatar answered Oct 03 '22 22:10

John Carter