Created
October 7, 2012 02:46
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.