APP crash with jTCPSocketClient lazarus / 43-Android ---------------------------------------------------------------------- schumi · 2019-09-25 06:58 hi, I have a strange problem, my APP use jTCPSocketClient for send end receive simple string with PC. With old device, smart monitor with android 4.4.2 working very well, now with new device, smart monitor same brand with android 7.1.2 app crash (freeze) at second connection with server, all the rest working normaly, freeze only on SendMessage / MessagesReceived but at the SECOND time. I have upgrade at last LAMW from github, change init() --> InitShowing() but the problem persist. someone have any advice? thank you ---------------------------------------------------------------------- jmpessoa · 2019-09-25 15:13 Hi,  schumi Maybe you have some "run time permission"  issue... ---------------------------------------------------------------------- schumi · 2019-09-26 13:31 Quote from: jmpessoa on September 25, 2019, 05:13:17 pm Hi,  schumi Maybe you have some "run time permission"  issue... the APP have all permission in settings, how can I check run time permission ? I make some test, ConnectAsync or ConnectAsyncTimeOut working normaly, but after the 2nd time CloseConnection() app don't respond. thanks ---------------------------------------------------------------------- jmpessoa · 2019-09-26 16:21 Quotehow can I check run time permission ? You need run time permission for some "critical"  use... ex.  Read/Write files... and others... The demo "AppCameraDemo" [and many others..]  show some use.... ---------------------------------------------------------------------- schumi · 2019-09-27 16:00 I have try this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if FConnected and IsRuntimePermissionGranted('android.permission.INTERNET') and      IsRuntimePermissionGranted('android.permission.ACCESS_NETWORK_STATE') and      IsRuntimePermissionGranted('android.permission.CHANGE_NETWORK_STATE') then  begin    ....  end  else  ShowMessage('Sorry... Some Runtime Permission NOT Granted ...'); but don't change, very strange thanks for reply ---------------------------------------------------------------------- schumi · 2019-09-30 08:42 I have tryed with other device with android 7.0 and android 8.0, same problem. I suspect a problem with jTCPSocketClient and android >=7, someone use this component? thanks ---------------------------------------------------------------------- schumi · 2019-10-04 12:02 Hi, nobody use jTCPSocketCLient on android >= 7 ??? thanks ---------------------------------------------------------------------- jmpessoa · 2019-10-04 20:50 Hi, schumi! I will try do some test here..... ---------------------------------------------------------------------- schumi · 2019-10-05 07:22 Quote from: jmpessoa on October 04, 2019, 10:50:31 pm Hi, schumi! I will try do some test here..... thank you a lot ---------------------------------------------------------------------- schumi · 2019-10-14 20:49 I try to fix AppTCPClientDemo1 with runtime permission, but don't work. ---------------------------------------------------------------------- schumi · 2019-10-16 23:29 test with laz+fpc from fpcupdeluxe but same problem. on CloseConnection() freeze (or infinite loop) ---------------------------------------------------------------------- commanderz · 2019-10-29 20:35 this is jTCPSocketClient.java (why not to allow link file not in message?) and with my modification this is not loop againe, but not disconnecting too, compare your old jTCPSocketClient.java  with this and you see and find why becouse mRun not to going in stable false mode after mRunClose set to false; need to more think and beautifily this mehanics. jTCPSocketClient.java:  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i but 20000character lengs so no data in this (((((((((((fckg sht ---------------------------------------------------------------------- schumi · 2019-10-29 20:52 I tried to modify jTCPSocketClient.java but I'm not java programmer so I abandoned TCP and now I use HTTP that works perfectly!! thanks ---------------------------------------------------------------------- ADiV · 2019-10-31 12:59 Fixed "jTCPSocketClient" [by TR3E] I attach the file, Greetings! ---------------------------------------------------------------------- schumi · 2019-10-31 18:11 Quote from: TR3E on October 31, 2019, 01:59:08 pmFixed "jTCPSocketClient" [by TR3E] I attach the file, Greetings! Thanks! I will try it ---------------------------------------------------------------------- rca · 2019-10-31 21:53 Quote from: TR3E on October 31, 2019, 01:59:08 pmFixed "jTCPSocketClient" [by TR3E] I attach the file, Greetings! Thank you for your support to improve LAMW. I tried your file with a smartphone and Android 7 Using the example AppTCPClientDemo. I connect to a server PC via TCP. Windows 10 Using the example of Inet. "testnet" From the smartphone to the PC, everything OK. But the moment I send a message from the PC to the smartphone, the mobile app closes. With the original file, neither the transmission nor the reception worked for me. With yours only fails me at the reception. Cordially, ---------------------------------------------------------------------- commanderz · 2019-11-02 09:25 Quote from: TR3E on October 31, 2019, 01:59:08 pmFixed "jTCPSocketClient" [by TR3E] I attach the file, Greetings! Work very well. But if click Connect/Disconnect buttons very fast - something going wrong, but if not fast - all ok. TR3E, Thanks a lot! ---------------------------------------------------------------------- ADiV · 2019-11-05 10:55 Hello, I have corrected the errors you commented to me. Improving the source code. I send it attached in addition to the updated example. ---------------------------------------------------------------------- rca · 2019-11-05 23:18 Quote from: TR3E on November 05, 2019, 11:55:36 amHello, I have corrected the errors you commented to me. Improving the source code. I send it attached in addition to the updated example. Excellent! I tried it and now it works perfect. Thank you.