0 votes
by (320 points)

I am currently writing the GUI for android. Based on your suggestion i have implemented a class called Emptyclass which is implementing the IScreen interface. However after binding and calling setcustomscreen i am not getting any callback to the methods of EmptyClass. Our expectation is when the connection is established a welcome screen of our terminal emulator need to get displayed. For this it need to call the write method of IScreen implemented class. However non of the methods of Emptyclass are getting called. Please find the below code snippet and suggest me changes.

EmptyClass et = new EmptyClass(this); //Emptyclass implements IScreen
SetContentView (et);//Resource.Layout.Main);
Telnet te = new Telnet("10.77.66.193",23);

Rebex.TerminalEmulation.VirtualTerminal vt = new Rebex.TerminalEmulation.VirtualTerminal(500,500);
try{
vt.Bind (te);
Rebex.TerminalEmulation.Interop.TerminalExtensions.SetCustomScreen (vt, et);
}catch(Exception e) {

};

by (70.2k points)
I noticed that you are creating VirtualTerminal(500,500);
Please note that standard terminal size is 80x25. More over, you want to display it on Android device which has much smaller display than PC.
It seems to me unreasonable to create such big terminal.

1 Answer

0 votes
by (70.2k points)

Please note, that data are not processed automatically. You have to instruct the terminal what to do.

In your case, you want to process received data continuously, so add this line at the end:

while (vt.Scripting.Process(1000) != TerminalState.Disconnected);

Or better, start this routine in a background thread, so the GUI is not blocked.

...