Jump to content

ertank

Members
  • Content Count

    246
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ertank

  1. ertank

    FMX Platform Frame design

    Thank you for clarifying situation about frames and pointing out an alternative solution. Alternative solution seemingly easy to implement. Unfortunately, I cannot switch my entire app into this now.
  2. Hello, I am using Delphi 10.3.2. There is an app for Android 5.1.1 platform only. It was working good. I do not remember when actually, but it was fine for sure. Problem now is that I get segmentation fault 11 when application is terminating. I cannot find in code reason why. I get following error in debugger after running Application.Terminate() or using Android back button which closes app: First chance exception at $00000000. Exception class Segmentation fault (11). Process Project1.apk (9547) Execution stops in System.pas at following lines: function _InstClear(var Dest: TObject): Pointer; {$IFDEF PUREPASCAL} var P: Pointer; begin Result := @Dest; if Dest <> nil then begin P := Pointer(Dest); Pointer(Dest) := nil; TObject(P).__ObjRelease; // <-- Exactly right here end; end; My call stack at that time is something as following: Lastly, my local variables are as following: I do not have anything complicated in that app. One thing which maybe relevant is that I pass some visual components (TMemo, TLabel) to a unit without form. These components are written text in them in a thread. I am using something like following to modify their values: TThread.Synchronize(nil, procedure begin BalanceLabel.Text := FormatFloat('#,##0.00', LocalBalance / 100); end); I have checked more than once to see if I am missing one visual component. I could not see any. I have googled with no luck. All my tests, debug runs returned no clue to me. Any hints to finding such FMX exceptions is appreciated. Thanks & regards, Ertan
  3. ertank

    Android - Segmentation fault (11) when closing app

    Does it also mean that I cannot be the source of the problem? I am not sure I used TFormRegistryItem t must be some visual component that I am using like TTabControl, TListView, TPanel, TLabel, TMemo, TImage etc.
  4. ertank

    Android - Segmentation fault (11) when closing app

    I could re-produce that error simply by running the app and once it is completely settled, closing it. Even for that I have spend several hours and tracked problem down to specific database operation(s). I use UniDAC and suspected that their native DBF (dBase) support might be the problem. I have remarked relevant code lines and continue my development. At some point, I needed these database operations and removed their remarks. It is very strange that after that error is not each time but random. I am not getting that error anymore, now. I do know same lines are called at each time and they are doing exact same things. If it appears again, I am going to directly check these database operations though. Thanks for the help.
  5. ertank

    Android - Segmentation fault (11) when closing app

    These are visual components placed on form. There is no code to create/free them. non visual units use them just for status update of the running thread.
  6. Hello, I am using Delphi 10.3.2. There is a project where I am communicating with another app (I will call it "other app"). Communication with other app is over clipboard. Other app is developed on Android Studio and is using some embedded device specific SDK. Other app is not a service app. It is a regular app without user interface (completely runs in the background). If that other app is not running, my app runs it. Waits until it settles completely. Starts communication. I am now asked to close that other app when my app closes. Even if I could run it using an intent, I did not find any Delphi FMX example to close it. Embedded device is running Android 5.1.1. That is unlikely to change in a near future. I believe there maybe no problem of "dangerous permissions" or similar at that Android version. Any help is appreciated. Thanks & regards, Ertan
  7. ertank

    Android - Find other app pid number and kill it

    That works nicely after adding "Kill backgound processes" permission. Thanks.
  8. In case you are taking your off-site backups on a Linux server, you might want to have a look at scp (Secure Copy). On Windows there is Putty which is free and has pscp.exe doing same job.
  9. ertank

    AES Encryption - FMX

    I failed to find a way to manually provide key and IV for AES256-CBC as byte values for that component set. However, as already indicated I use CryptoLib4Pascal successfully on VCL and FMX with help from @Ugochukwu Mmaduekwe
  10. ertank

    AES Encryption - FMX

    I could use CryptoLib4Pascal cross-platform successfully with help from @Ugochukwu Mmaduekwe My test code looks like following: uses System.NetEncoding, ClpIBufferedCipher, ClpCipherUtilities, ClpIParametersWithIV, ClpParametersWithIV, ClpParameterUtilities; procedure TForm2.Button1Click(Sender: TObject); var Cipher: IBufferedCipher; KeyParametersWithIV: IParametersWithIV; KeyBytes: TBytes; IVBytes: TBytes; Buf: TBytes; PlainText: TBytes; begin KeyBytes := [31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32]; IVBytes := [31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36]; PlainText := TEncoding.UTF8.GetBytes(Edit1.Text); Cipher := TCipherUtilities.GetCipher('AES/CBC/PKCS7PADDING'); KeyParametersWithIV := TParametersWithIV.Create(TParameterUtilities.CreateKeyParameter('AES', KeyBytes), IVBytes); Cipher.Init(True, KeyParametersWithIV); // init encryption cipher Buf := Cipher.DoFinal(PlainText); Edit2.Text := TNetEncoding.Base64.EncodeBytesToString(Buf); end; One who wants to use framework needs to put all directories & sub directories in Library Path, or use provided run-time packages. I did the former.
  11. ertank

    AES Encryption - FMX

    It is just there are internal references and functions using that type. Moreover, it includes about 65kb big commonly used unit that needs a lot more modifications than converting AnsiString that I don't want to dig into.
  12. ertank

    AES Encryption - FMX

    I heard about it. Did not give it a try yet.
  13. ertank

    AES Encryption - FMX

    I mostly use mORMot for my AES handling. Even it compiles on Linux FPC and Raspberry Pi, it doesn't compile for FMX. First compiler complaint is about AnsiString type. I tried pure Pascal Wolfgang Ehrhardt library and compiler is not happy with internal used type declarations in BType.pas file like type Str255 = string[255]; So I'm asking for help from anyone who used an AES encryption under FMX.
  14. Hello, I am using Delphi 10.3.2 and I have that project I need to use APDU commands communicating a Mifare card. I do not know java language. However, Android seems to have support for APDU commands for a very long time (like old versions such as 4.4 has that support). I have found following document: https://developer.android.com/reference/android/nfc/tech/IsoDep My problem is, I do not know APDU command use is possible with Delphi 10.3.2 on Android. I have found only one blog about RFID with Delphi FMX and that is for communicating smart tags. Unfortunately not providing help on APDU usage. http://blong.com/articles/delphixe7nfc/nfc.htm I can't find any other information about Delphi FMX and APDU. I appreciate any help. Thanks & regards, Ertan
  15. ertank

    Communicating RFID with APDU commands

    Unfortunately not a big help. I have read that article before posting my question in here. I do not know java language. I might use some small app running in the background just to communicate with RFID and send back my Delphi app replies for these commands though. Just not sure if that is possible. I would like Delphi to use IsoDep.transceive() in a way. Thanks for the help.
  16. ertank

    Dark theme

    Wondering if it is possible to have an option to choose dark theme for forum browsing. I failed to find such an option.
  17. ertank

    Dark theme

    That's a nice one.
  18. ertank

    TIdTCPClient - gpsd communication

    Hello, I am using Delphi 10.3.2, Indy version: 10.6.2.5366 (default coming with Delphi). There is a gpsd daemon running on a Raspberry Pi. It is broadcasting some json strings over TCP:2947 - I can successfully establish a connection using TIdTCPClient. There is no data incoming after connection. - Send command to stream my client these json strings after connection. There is no data incoming after sending command. Memo output: Memo1 Connecting to 192.168.1.90. Connected. On the other hand; - Using Putty, I instantly get initial greeting json string right after connection without sending anything. - if I send command to stream I instantly get json string replies. Putty terminal output: {"class":"VERSION","release":"3.17","rev":"3.17","proto_major":3,"proto_minor":12} ?WATCH={"enable":true,"json":true} {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyS0","activated":"2019-08-31T15:56:43.607Z","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]} {"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false} My current test code: unit uMain; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, Vcl.ExtCtrls, Vcl.StdCtrls; type TForm2 = class(TForm) IdTCPClient1: TIdTCPClient; Memo1: TMemo; Timer1: TTimer; Button1: TButton; procedure IdTCPClient1Connected(Sender: TObject); procedure IdTCPClient1Disconnected(Sender: TObject); procedure IdTCPClient1Status(ASender: TObject; const AStatus: TIdStatus; const AStatusText: string); procedure Timer1Timer(Sender: TObject); procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } SentStreamCommand: Boolean; public { Public declarations } end; var Form2: TForm2; implementation {$R *.dfm} procedure TForm2.Button1Click(Sender: TObject); begin if Button1.Tag <> 0 then begin IdTCPClient1.Disconnect(); Button1.Caption := 'Connect'; Button1.Tag := 0; end else begin IdTCPClient1.Connect('192.168.1.90', 2947); Button1.Caption := 'Disconnect'; Button1.Tag := 1; end; end; procedure TForm2.FormCreate(Sender: TObject); begin Timer1.Enabled := False; SentStreamCommand := False; end; procedure TForm2.FormDestroy(Sender: TObject); begin if IdTCPClient1.Connected then IdTCPClient1.Disconnect(False); end; procedure TForm2.IdTCPClient1Connected(Sender: TObject); begin Timer1.Enabled := True; end; procedure TForm2.IdTCPClient1Disconnected(Sender: TObject); begin Timer1.Enabled := False; end; procedure TForm2.IdTCPClient1Status(ASender: TObject; const AStatus: TIdStatus; const AStatusText: string); begin Memo1.Lines.Add(AStatusText); end; procedure TForm2.Timer1Timer(Sender: TObject); var ReceivedText: string; begin Timer1.Enabled := False; try with IdTCPClient1 do begin if not Connected then Exit(); // read any data in if IOHandler.InputBufferIsEmpty then begin IOHandler.CheckForDataOnSource(0); IOHandler.CheckForDisconnect; if IOHandler.InputBufferIsEmpty then Exit(); ReceivedText := IOHandler.AllData(); if ReceivedText <> EmptyStr then Memo1.Lines.Add(ReceivedText); end; // if not already, send streaming command if not SentStreamCommand then begin IdTCPClient1.IOHandler.WriteLn('?WATCH={"enable":true,"json":true}'); SentStreamCommand := True; Exit(); end; end; finally if IdTCPClient1.Connected then Timer1.Enabled := True; end; end; end. I would like to understand what I am doing wrong. My main purpose is to read each json string separately as they are incoming one per line. I appreciate any help, please. Thanks & regards, Ertan
  19. ertank

    TIdTCPClient - gpsd communication

    That code did work. Though, it block my main thread. I just need to modify my logic slightly and put it in a thread and call a procedure once some json is in. I will definitely use some json parser. I simply failed to get data from server to start parsing it. Thank you.
  20. Hello, Everybody has own needs. Working on a multi-monitor system. I do not want to have IDE jump from one monitor to other when I start debugging. I failed to find a report about that and add one myself. https://quality.embarcadero.com/browse/RSP-25646 It is indicated to be under consideration. I would like if you choose to vote for it. I do strongly believe that will help people working using Delphi on a multi-monitor systems. Thanks & regards, Ertan
  21. ertank

    IDE changes monitor when debug run

    I also vote for that. As that will also keep the monitor IDE runs.
  22. ertank

    IDE changes monitor when debug run

    Monitor where you save layout is stored now. My part, I do not want it to store that.
  23. Hello, I am using Delphi 10.3.2. There is that Delphi7 project which uses over 200 units and forms. I am asked to migrate it to Delphi Rio. There are some components used for skinning that will be removed during migration. Other than this, code is mostly compatible. However, I cannot have a good compile. I get one of below errors too frequently that it gets a person fed up. Consider each line as an error returned after a different compile Could not create output file 'DCU-DEBUG\xyz.dcu' File not found: 'UnitMainForm.pas' File not found: 'UnitLogin.pas' File not found: 'UnitSalesEntry.pas' File not found: 'ERP.dpr' I am sure all these files exists. I did not copy-paste them. Used SVN to have all files in my computer. Removing all add-ons, even IdeFixPack and problem still exists. Files are on an SSD drive and there is plenty of free space on that drive. "DCU-DEBUG" folder is writable by Delphi. I do not have any errors reported by Delphi when closing (tested to see if some memory leaks or similar). I failed to find a fix for that problem and asking in here in case someone else might faced that before and can suggest a solution. Thanks & regards, Ertan
  24. I finally got a regular HDD (spin drive) and when using it compilation works. It also gives errors like above, but so rare that you can ignore them. All SMART checks on all drives are good. Now, I wonder if it is Windows 10 thing appeared with its latest update or something. I still cannot find a reason why creating files on disk fails or why it cannot find existing files.
  25. Disabling real-time virus scanner is not helping. I also used another drive and still got same problem. For the record one of the drives were NVMe and other was SSD both being pro grade drives. Using NVMe drive seemingly results in having less of the problem. I am yet to find and try with regular spin drive.
×