Jump to content

ertank

Members
  • Content Count

    246
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ertank

  1. ertank

    Android short time format 24h/12h

    Hello, Android has 24H/12H hour display format setting. I wanted to format my time values displayed as in system settings but I couldn't find how to read that specific is24HourFormat value. Delphi TFormatSettings does not include that information. There are earlier SO threads like this one. But that code gives me Invoke error: method not found. I also tried to import "android/icu/text/DateFormat" that I found in another SO answer and the app crashes without any error displayed. What would be the correct way to read that system setting? Thanks & Regards, Ertan
  2. ertank

    Android short time format 24h/12h

    I tested it on Android 12 and and it is working just fine. Original SO answer was missing the case match of the function and its declaration type which I should be careful for the next time. Thanks for the help.
  3. ertank

    Delphi 12.2 Patch 1

    Speaking about Delphi 12.2 Inline Update 1. I am told that Windows 10 and Windows 11 changes the experience. Delphi is giving problems on Windows 11 and identical (down to installed components) system on Windows 10 works just fine.
  4. When I was adding Delphi 12.2 in our build server I remember below value was missing in rsvars.bat BDSLIB=C:\Delphi12.2\lib You need to point it to your correct directory.
  5. Answer to your question depends on your needs. I don't use ISS or Nginx for about 200 clients using MARS Curiosity as my REST server. mORMot2 is another Open Source Client-Server ORM SOA MVC framework and uses REST which tested to serve millions of requests under certain conditions. It is up to you to choose your REST server framework and any load balancer if you need it.
  6. ertank

    Newbie wants to start a simple database

    If you want to prevent others accessing the data input in the application, you can encrypt a SQLite3 database and data will not be able to read by other software unless your encryption key and method is found. https://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.SQLite_Encryption_Sample There are a lot to consider for saving data to disk file or reading from it. A database system already handles these for you.
  7. Below works for me without any exception. I see "All good" message and debugging shows data is actually in LResult variable. uses System.Net.HttpClient, System.Net.HttpClientComponent; procedure TForm1.Button1Click(Sender: TObject); var LHttp: TNetHTTPClient; LResponse: IHTTPResponse; LResult: string; begin LHttp := TNetHTTPClient.Create(Self); try try LResponse := LHttp.Get('https://www.google.com/index.html'); except on E: Exception do begin ShowMessage('Cannot communicate' + sLineBreak + E.Message); Exit(); end; end; if (LResponse.StatusCode < 200) or (LResponse.StatusCode > 299) then begin ShowMessage('Error status received'); Exit(); end; LResult := LResponse.ContentAsString(); ShowMessage('All good'); finally LHttp.Free(); end; end; You may want to test this code in a new project. If you do not get exception for google, but some other URL. You need to be sure that you are not downloading something binary. There are binary contents that can be retrieved using GET and these cannot be simply read as string. For example, I download my application update setup executables using GET into a TStream.
  8. Hi, I do not see any problem that may raise such an error in the shared code. You might want to check other events assigned to f_NetHTTPRequest. Exception may be raising in them. If you are sure that TIndigoHttp.GetText() is where the error occurs then which line is it? What is the computer codepage that you are making tests. BTW, your request might complete without exception. But response received might be an error. I would check if "f_StatusCode" is in successful response range. In my own code I check it to be ">= 200" and "<= 299"
  9. I would consider switching to an HTTP client of your choice and stop using TREST components.
  10. ertank

    Firebird database on Android

    I would suggest to use SQLite on a mobile device rather than FirebirdSQL if you do really need to save some data on the device itself. Is there any particular reason you want to use FirebirdSQL?
  11. ertank

    REST api: too much data

    Just check the link. There is OJson with "SAX" parsing as well.
  12. ertank

    REST api: too much data

    If your concern is high memory usage, you can try OXml and use SAX parser. If your data is well structured, you can also use Delphi classes together with SAX parsing. This would dramatically reduce memory consumption compared to System.JSON. http://www.kluug.net/oxml.php However, your problem is not clear as stated earlier. You might want to add details.
  13. ertank

    I'm on the Dark Side... no, really!

    I asked that before and got a suggestion for https://github.com/darkreader/darkreader Might work for you, too.
  14. Hello, This is a Windows Server 2022 where MARS is running on as a Windows service. There is no nginx or similar application between, so MARS Windows service is directly accessed. Not a heavy server at all. It is less than 10 simultaneous users at most and on average there is a single client accessing the server. I do not have any access to the server and I am not given any. It is reported that MARS Windows service is responding ECONNRESET error after random days of usage. Sometimes it is a month sometimes it is 10 days. There are application log files. They all seem fine. Last request is served then service is shutdown and restarted. There is no errors or request not completed according to logs. Once it happens it is the same error if MARS Windows service is tested to be used from localhost. I never had any problem with MARS. I have similar installations on Windows Server 2019/2022 with more simultaneous users which are running for years. My internet searches didn't help me much. Any help is appreciated. Thanks & Regards, Ertan
  15. ertank

    ICS Beta V9.2 and OpenSSL 3.3.0

    Hi, Those not needing to embed OpenSSL libraries, will it be enough to comment out {$DEFINE OpenSSL_Resource_Files} in OverbyteIcsDefs.inc? Thanks.
  16. ertank

    MyDAC : Unknown column error

    I am using UniDAC and there is TUniConnection.Options.KeepDesignConnected parameter. I expect MyDAC to have a similar parameter. I didn't understand why this is a problem since you have a single database and necessary columns added in it.
  17. ertank

    ICS V9.1 Highlights

    Is this a different server than http://svn.overbyte.be:8443/svn/
  18. ertank

    MyDAC : Unknown column error

    I don't use MySQL. But, I would use same letter case as the table column name. I would double check that design-time and run-time actually uses the same server, database, table Edit: Reading your problem again, it feels you added a column in TMyTable but not in your database table.
  19. I am not sure if below approach is suitable for you. type FieldList = TArray<TField>; PFieldList = ^FieldList; procedure FindAllFields(DataSet: TDataSet; Fields: PFieldList; const FieldNames: TArray<string>; const RaiseExceptionForMissingFields: Boolean = True); var I: Integer; begin Assert(Length(Fields^) = Length(FieldNames), 'Fields count <> FieldNames count!'); for I := Low(Fields^) to High(Fields^) do begin Fields^[I] := DataSet.FindField(FieldNames[I]); if (Fields^[I] = nil) and RaiseExceptionForMissingFields then raise Exception.Create('Missing field dataset "' + FieldNames[I] + '"'); end; end; procedure TForm1.Button1Click(Sender: TObject); var LFieldList: FieldList; begin SetLength(LFieldList, 4); // Below will raise an exception because of the last empty field name and RaiseExceptionForMissingFields=True FindAllFields(VirtualTable1, @LFieldList, ['a', 'b', 'c', '']); //... end; This would require you to remember Indexes for your fieldnames. Not very convenient if you are to have a lot of fields and do different calculations or such with them.
  20. Check out MadExcept. It can check for frozen main thread and auto restart.
  21. license.embarcadero.com gives error in the installer.
  22. For me license servers are still down.
  23. ertank

    SAX parser

    I own a commercial license and used SAX parsing in OXml. You might want to check out https://github.com/ashumkin/OXML This is an old version. Though license allows you to use it in commercial applications under certain conditions and it might work for you.
  24. As per documentation TStringHelper.ToUpper uses locale specific case conversion. As per documentation UpperCase or SameText uses 7-bit ASCII conversion. Only letters between 'a' and 'z' are converted to uppercase. Since you are using ToUpper, uppercase of 'This' in Turkish locale is 'THİS' (upper case I letter with dot at top). Moreover, lower case for 'THIS' in Turkish locale is 'thıs' (small caps i letter without dot at top). I cannot remember off my mind right now but there are other languages where some characters small and upper cases do not follow ASCII type of conversion.
  25. ertank

    Install failed older sdk

    Hello, I am using Delphi 10.4.2 I have a project that I developed about three years ago for a specific Android 5.1.1 device built in China. I do not remember what Delphi version I was using at that development time three years ago. Today, I need to do some modifications to that project. There is no problem compiling. When I try to debug run, I get error "Failure INSTALL_FAILED_OLDER_SDK" at deployment phase. When I check for min supported Android version is listed as Android 5.1 here https://docwiki.embarcadero.com/RADStudio/Sydney/en/Android_Devices_Supported_for_Application_Development I do not know if anything changed for Delphi 10.4.2 as I could not find a specific documentation about it. Is there anything I can do to fix this problem? Thanks & Regards, Ertan
×