Issues with Client Socket Extension


#1

Hi all!
Extensions from App inventor do not work with AppyBuilder Gold?
The ClientSocketAI2Ext1 extension built in App Inventor works well, and in AppyBuilder produces the error "Connect error (Socket Creation) null


#2

@STX-121 They should. Did you restart the companion and kill the other companions? What is the link to the extension?


#3

I greet you, Hossein!
Yes, only one client is connected.
The problem is that the aia-file built in the App Inventor works correctly, and the same file built in AppyBuilder produces a socket creation error.
Extension: com.gmail.at.moicjarod.ClientSocketAI2Ext.aix (22.2 KB)
here: https://groups.google.com/forum/#!topic/mitappinventortest/OCzEZC4FpEU


#4

@STX-121 Do you have a simple .aia that we can use to test out this issue?


#5

Yes, of course, attached it
TestSocket.aia (24.9 KB)


#6

@STX-121 I was able to load the sample .aia with no problem. This may be logic error. Check code below. As soon as you Connect, you are trying to check for connection status. Seems like there should be an EVENT BLOCK that should be triggered AFTER connection is established. If that block exists, you’ll need to move your IF-ELSE code in there.


#7

The file is loaded and built without problems. But it does not work if it was built by AppyBuilder.

Application build by App Inventor is connected to TCP-port correctly:

TestSocket_AI

Application build in AppyBuilder produces an error:

TestSocket_AB


#8

@STX-121 what do we have to do on our side to be able to set up server and connect to socket? I’m just trying to reproduce this issue.


#9

In the “Address” field, you can enter the address of any site, for example “Google.com”. In the “Port” field - 80. Pressing the “Connect” button should open the TCP connection (here there is a socket creation error).

Thank you for your help, for me this extension is the only possible solution.


#10

@STX-121 thanks for info. Will check and report back. Also will try to get in touch with extension developer to see if they can test with AppyBuilder too.


#11

@STX-121

We are seeing errors AI too:


#12

This is a connection timeout error.
It looks at the address 172.217.7.174 is not open port 10000. You can try to connect to a known open TCP-port?
I checked it on two android-phones and on the Nox emulator, the result is repeated.
Connect to google.com/port 80:
Apk-file created in App Inventor successfully connected, apk-file create in AppyBuilder gives an error (Connect Creation) null.

I attach aia-file aimed at google.com:80
TestSocket.aia (24.9 KB)


#13

I contacted the extension developer, that’s his answer:

Hello Evgeny,

Well, when there is the error (exception) you gave me in the image, it should add the reason for the error. Unfortunately the message given for the error is “Null” in your case (because you are using AppyBuilder instead of App inventor I used). I think the socket support in AppyBuilder is not complete or at least this part doesn’t work properly. This exception is raised on line 289 of my source file ClientSocketAI2Ext.java. You can try also to do an “adb logcat” with a PC connected to the phone and try to discover what is problematic.
I don’t have the time for the moment (and for a long moment, many things to do prior to improve this extension) to test and try to debug this problem and don’t have a gold account also. If you have a gold account (what I understood), you could send a ticket to AppyBuilder admins to ask them why an extension working in Appinventor doesn’t work with their AppyBuilder.

Sorry not for beeing able to help you more than that.

Cheers,

Jean-Rodolphe Letertre


#14

@STX-121 he is providing the code. We’ll check into it and definitely have answer for you by tomorrow.


#15

Thank you Hossein!
It’s great, I’m looking forward to it.


#16

@STX-121 Take below AppyBuilder extension[1] and import into your project. I believe there are some error handling missing in original extension. The extension[1] will compliment extension[2] to overcome this issue. You don’t need to do ANY additional coding. Just drop it in designer as shown in [3]

image

[1] com.appybuilder.ClientSocket.aix (5.0 KB)

[2] com.gmail.at.moicjarod.ClientSocketAI2Ext.aix

[3]


#17

Thanks Hossein!
Works great, the data is transmitted correctly!


#18

Glad to know that. I’ll discuss my updates with extension developer


#19

I noticed one more trouble. It is present independently of the build-server.
When disconnecting from the TCP-port, the application almost always ends up crashing.
My project does not use TCP-Disconnect, so for me this error is not critical. Its extension performs well!

com.google.appinventor.components.runtime.errors.YailRuntimeError: Connect error (read) Socket closed
at com.gmail.at.moicjarod.ClientSocketAI2Ext $ 1.run (ClientSocketAI2Ext.java:263)
at java.lang.Thread.run (Thread.java:761)


#20

@STX-121 just to clarify; same behavior in MIT AI?