Skip to content

Instantly share code, notes, and snippets.

@shifei010
Created October 7, 2012 02:46
Show Gist options
  • Save shifei010/3846918 to your computer and use it in GitHub Desktop.
Save shifei010/3846918 to your computer and use it in GitHub Desktop.
Using bottle.py and SL4A to build an Android Web Server for your phone / tablet
http://www.marginhound.com/using-bottle-py-and-sl4a-to-build-an-android-web-server-for-your-phone-tablet/
from bottle import route, run, template,validate, static_file
from multiprocessing import Process
droid = android.Android()
def showurl(url=”http://localhost:8080“):
time.sleep(5)
droid.webViewShow(url)
@route(‘/’)
def home_page():
return static_file(“index.html”,root=’scripts/’)
p=Process(target=showurl)
p.start()
run(host=’localhost’, port=8080)
@AsMoh
Copy link

AsMoh commented Dec 25, 2014

Hi,
I am new to bottle and SL4A. I did not understand how to use this code to build an Android Web Server. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment