I am prototyping an android app with bottle and sl4a. Running into some trouble with some code. I am using multiprocessing to set a 5 second delay on a function that opens up a webview to the localhost so when i run the server it has time to setup before the webview requests the site. For some reason it is not opening up a webview. ( script is not exiting and leaves no errors to figure out what is working incorrectly) I can run the server in one script and run an alternate script that opens up the webview and it works just fine. Can anyone see a problem in my code as I do not want to have separate scripts since I plan on wrapping this all up in an apk with sl4a and pythonforandroid.
I stripped most of my code for simplicity.
from bottle import route, run, template, static_file, redirect, request
from multiprocessing import Process
import android
def showurl():
time.sleep(5)
droid.webViewShow("http:\/\/localhost:8080")
if __name__ == '__main__':
droid = android.Android()
port = int(os.environ.get('PORT', 8080))
p = Process(target=showurl)
p.start
run(host='localhost', port=port, debug=True)
Thanks in advance!