#NEWLINE# def test_075_httpserver( ) : #NEWLINE# #INDENT# import time #NEWLINE# import threading #NEWLINE# import BaseHTTPServer #NEWLINE# fname = '/sdcard/sl4a/test_075.html' #NEWLINE# port = 9090 #NEWLINE# class Handler ( BaseHTTPServer . BaseHTTPRequestHandler ) : #NEWLINE# #INDENT# def do_GET( s ) : #NEWLINE# #INDENT# file ( fname , 'w' ) . write ( '\n                <html><head></head><body>fine 075</body></html>' ) #NEWLINE# html = open ( fname , 'rb' ) #NEWLINE# s . send_response ( 200 ) #NEWLINE# s . send_header ( 'Content-Type' , 'text/html' ) #NEWLINE# s . end_headers ( ) #NEWLINE# s . wfile . write ( html . read ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# server_class = BaseHTTPServer . HTTPServer #NEWLINE# httpd = server_class ( ( '' , server_class ) , Handler ) #NEWLINE# if ( not skip_gui ) : #NEWLINE# #INDENT# th = threading . Thread ( target = httpd . serve_forever ) #NEWLINE# th . start ( ) #NEWLINE# droid . startActivity ( 'android.intent.action.VIEW' , 'http://127.0.0.1:9090/' ) #NEWLINE# time . sleep ( 3 ) #NEWLINE# httpd . shutdown ( ) #NEWLINE# #UNINDENT# return True