sl4a python make a Toast for android phone -
i wrote 3 lines in python using sl4a:
import android droid = android.android() droid.maketoast(u"ascc4r")
when code runs, following error:
pydev debugger: starting traceback (most recent call last): file "c:\users\tibi\desktop\adt-bundle-windows-x86_64-20130917\eclipse\plugins \org.python.pydev_2.8.2.2013090511\pysrc\pydevd.py", line 1446, in <module> debugger.run(setup['file'], none, none) file "c:\users\tibi\desktop\adt-bundle-windows-x86_64-20130917\eclipse\plugins org.python.pydev_2.8.2.2013090511\pysrc\pydevd.py", line 1092, in run pydev_imports.execfile(file, globals, locals) #execute script file "c:\users\tibi\workspace\26\src\26module.py", line 7, in <module> droid = android.android() file "c:\python26\lib\android.py", line 34, in __init__ self.conn = socket.create_connection(addr) file "c:\python26\lib\socket.py", line 547, in create_connection res in getaddrinfo(host, port, 0, sock_stream): socket.gaierror: [errno 11001] getaddrinfo failed
environment setup: - python 2.6.6 - set ap_port=9999 - adb forward tcp:9999 tcp:xxxx (xxxx started server on phone) android.py in python/lib folder.
update: tried 3 instruction in cmd , it's work, making toast. think fault in adt bundle, or eclipse python plugin.
what errno 11001?
what errno 11001?
i don't know error, suggest use correct syntax is
import android droid = android.android() droid.maketoast('my text print should inside quotes')
see api overview
Comments
Post a Comment