Recent

Author Topic: APP crash with jTCPSocketClient  (Read 3912 times)

schumi

  • New Member
  • *
  • Posts: 40
APP crash with jTCPSocketClient
« on: September 25, 2019, 08:58:11 am »
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

  • Hero Member
  • *****
  • Posts: 2297
Re: APP crash with jTCPSocketClient
« Reply #1 on: September 25, 2019, 05:13:17 pm »

Hi,  schumi

Maybe you have some "run time permission"  issue...
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #2 on: September 26, 2019, 03:31:51 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

  • Hero Member
  • *****
  • Posts: 2297
Re: APP crash with jTCPSocketClient
« Reply #3 on: September 26, 2019, 06:21:43 pm »
Quote
how 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....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #4 on: September 27, 2019, 06:00:42 pm »
I have try this:
Code: Pascal  [Select][+][-]
  1. if FConnected and IsRuntimePermissionGranted('android.permission.INTERNET') and
  2.       IsRuntimePermissionGranted('android.permission.ACCESS_NETWORK_STATE') and
  3.       IsRuntimePermissionGranted('android.permission.CHANGE_NETWORK_STATE') then
  4.   begin
  5.     ....
  6.   end
  7.   else  ShowMessage('Sorry... Some Runtime Permission NOT Granted ...');

but don't change, very strange
thanks for reply

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #5 on: September 30, 2019, 10:42:20 am »
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

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #6 on: October 04, 2019, 02:02:24 pm »
Hi,
nobody use jTCPSocketCLient on android >= 7 ???

thanks

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: APP crash with jTCPSocketClient
« Reply #7 on: October 04, 2019, 10:50:31 pm »

Hi, schumi!

I will try do some test here.....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #8 on: October 05, 2019, 09:22:36 am »

Hi, schumi!

I will try do some test here.....
thank you a lot

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #9 on: October 14, 2019, 10:49:51 pm »
I try to fix AppTCPClientDemo1 with runtime permission, but don't work.
 :( :( :(

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #10 on: October 17, 2019, 01:29:54 am »
test with laz+fpc from fpcupdeluxe but same problem.
on CloseConnection() freeze (or infinite loop) >:(

commanderz

  • New Member
  • *
  • Posts: 11
Re: APP crash with jTCPSocketClient
« Reply #11 on: October 29, 2019, 09:35:08 pm »
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][+][-]
  1. but 20000character lengs so no data in this (((((((((((
  2. fckg sht
  3.  
  4.  

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #12 on: October 29, 2019, 09:52:28 pm »
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

  • Jr. Member
  • **
  • Posts: 90
    • ADiV Software
Re: APP crash with jTCPSocketClient
« Reply #13 on: October 31, 2019, 01:59:08 pm »
Fixed "jTCPSocketClient" [by TR3E]

I attach the file, Greetings!

schumi

  • New Member
  • *
  • Posts: 40
Re: APP crash with jTCPSocketClient
« Reply #14 on: October 31, 2019, 07:11:52 pm »
Fixed "jTCPSocketClient" [by TR3E]

I attach the file, Greetings!

Thanks!
I will try it

 

TinyPortal © 2005-2018