sl4a python make a Toast for android phone
Question: I wrote only this 3 lines in python using
[SL4A](http://code.google.com/p/android-scripting/):

    
    
        import android
        droid = android.Android()
        droid.makeToast(u"ascc4r")
    

When this code runs, I get the 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 the 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
        for 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 where I started the server on the phone) My android.py is in
the Python/Lib folder.

Update: I tried this 3 instruction in CMD and it's work, making a Toast. So I
think the fault is in the ADT bundle, or Eclipse Python plugin.

What is this Errno 11001?


Answer: > What is this Errno 11001?

I don't know about that error, but I suggest to use the correct syntax which
is

    
    
     import android
     droid = android.Android()
     droid.makeToast('my text to print should be inside the quotes')
    

see also the [API Overview](http://code.google.com/p/android-
scripting/wiki/AndroidFacadeAPI)

