Jump to content

ertank

Members
  • Content Count

    233
  • Joined

  • Last visited

Everything posted by ertank

  1. Actually it is possible. License days start counting down from the day you activate it for the first time. Moreover, if you register and get a free license today it will have 366 days left.
  2. I am using Delphi 10.3.3 Community Edition right now. I did have license failure just once for a Community Edition. It was after I changed computer name of Windows. I do not remember having frequent IDE crashes at all.
  3. ertank

    Android 64bit and 32bit permissions

    Hello, I am using Delphi 10.3.3, targeting Android 64Bit and 32Bit. Attached is a test project I used. If that same project is compiled for Android 32Bit it gets two permission request as can be seen in below pictures However, if same code without changing anything is compiled for Android 64Bit it only asks for a single permission as can be seen in below picture Both bitness apk files are tested on same physical phone running Android 9. I have tried to change order of permissions in request to see if this is related with request order. I always get same above permission asked on 64bit version. Let me know if you think this is a bug in Delphi, please. Thanks & regards, Ertan Android64Bit_Permisions.7z
  4. ertank

    Android 64bit and 32bit permissions

    That's it. I should have spotted that. I guess I am still not used to different settings on 32Bit and 64Bit of same OS. Thanks.
  5. ertank

    Android 64bit and 32bit permissions

    Changed phone language to English for any possible future questions. Thanks.
  6. Hello, I am using Delphi 10.3.3, Indy 10.6.2.5366 (stock Indy version) I am trying to listen broadcast UDP messages on Android (exact version I am testing is 4.4.2, I need to support latest versions, too) connected to a local WiFi. Broadcast messages will be sent in same network. I have found this page https://stackoverflow.com/questions/19040674/delphi-xe5-tidudpserver-does-not-receive-anything-on-android and tried to do it as to my understanding. Project has CHANGE_WIFI_MULTICAST_STATE permission set. UDP server parameters are as following at design time and everything else is left as default: TIdUDPServer.Active = False TIdUDPServer.BroadcastEnable = True TIdUDPServer.DefaultPort = 8080 I have following code where timer is activated as last line in OnFormCreate() event and has 0.5 seconds delay: procedure TForm3.tmrCheckPhoneServiceTimer(Sender: TObject); var WifiManagerObj: JObject; begin // Run just once tmrCheckPhoneService.Enabled := False; // Get necessary OS settings to receive broadcast messages Log('Getting multicast lock...'); WifiManagerObj := TAndroidHelper.Context.getSystemService(TJContext.JavaClass.WIFI_SERVICE); FWifiManager := TJWifiManager.Wrap((WifiManagerObj as ILocalObject).GetObjectID); FMulticastLock := FWifiManager.createMulticastLock(StringToJString('LightFactory Remote')); FMulticastLock.setReferenceCounted(True); FMulticastLock.acquire(); // Try to open a port on Android by sending a broadcast message Log('Sending a broadcast message...'); IdUDPServer1.Broadcast('test', IdUDPServer1.DefaultPort); // Now we can start to listen Log('Activating UDP listener...'); IdUDPServer1.Active := True; if FPhoneDialerService = nil then begin TDialogService.ShowMessage('PhoneDialer service not supported'); Exit(); end; PermissionsService.RequestPermissions([FCallPhonePermission], MakePhoneCallPermissionRequestResult, DisplayRationale); end; I have following code in my OnDestroy() event: procedure TForm3.FormDestroy(Sender: TObject); begin // Stop listenning. IdUDPServer1.Active := False; // Release multicast lock FMulticastLock.release(); end; My broadcast listening code is as following: procedure TForm3.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread; const AData: TIdBytes; ABinding: TIdSocketHandle); var Data: string; begin Data := TEncoding.Default.GetString(AData); TThread.Queue(nil, procedure begin Log('Incoming broadcast message from: ' + ABinding.PeerIP) end); if SameText(Data, 'mytriggerphrase') then begin TThread.Queue(nil, procedure begin TestConnection(ABinding.PeerIP) end); end; end; After I run the app, I have following in my log: 2020-01-14 00:59:33.697 Getting multicast lock... 2020-01-14 00:59:33.736 Sending a broadcast message... 2020-01-14 00:59:33.740 Activating UDP listener... 2020-01-14 00:59:33.804 Incoming broadcast message from: 192.168.1.186 That IP number in above log belongs to Android device itself. I have following problems that I could not figure a solution: 1- I do not get any other broadcast message from my PC application which is sending one broadcast message each second. Is there anything I am doing wrong for that to happen? 2- I get segmentation fault (11) when closing my app. Detailed call stack and exact line is in attached picture. This happens each and every close. I did not understand why. Lastly, I am not sure if my code is doing it correct to keep multicast lock thru all run-time. I read a suggestion to release a multicast lock once finished with it in order to save battery life. So, I wonder if I can release multicast lock right after enabling my TIdUDPServer? Any help is appreciated. Thanks & regards, Ertan
  7. So far I have tried following on a fresh project using one TIdTCPServer and one TIdIPMCastServer: - Set Active property to False any Indy component on form manually way before closing app: Failed - Set Active property to False any Indy component on form manually. Free them way before closing app: Failed - Remove all auto-create components. Create them using code without owner. Set Active property of them to False way before closing app: Failed - Remove all auto-create components. Create them using code without owner. Set Active property of them to False. Free them at run-time way before closing app: Failed - Remove all auto-create components. Create them using code without owner. Set Active property of them to False. *Do not* Free them at run-time and close app: Failed (this one was just for my curiosity) I get very similar call stack for all tests above. Then I tried to do some tests using just a single component: - Using run-time created TIdTCPServer with no owner. Active property set to False at run-time. *Did not* free and closing app: No exception (just some memory leak obviously) - Using run-time created TIdTCPServer with no owner. Active property set to False at run-time. Freed before closing app: No exception - Using run-time created TIdTCPServer with no owner. Active property *not* set to False at run-time. Freed before closing app: No exception - Using design-time placed TIdTCPServer with no owner. Active property set to False at run-time way before closing app: Failed - Using run-time created TIdIPMCastServer with no owner. Active property set to True, used TIdIPMCastServer.Send() and property set to False. Freed at run-time way before closing app: No exception It is interesting that using either component alone created at run-time is not failing at all. Mixing them both seems to be having a problem. Using TIdUDPClient for sending broadcast messages with TIdTCPServer also failing. In anyway, it seems to be best creating components at run-time as putting them on form at design time is always failing.
  8. ertank

    Need help adding namespaces to SOAP

    I was more suggesting alternative way to use your web service. Something like semi-manual Delphi SOAP web service use. It is sometimes easier to explain in code. Please check attached demo. Especially file "ISrvConsultaCartera.WS.pas". I could not test everything as your URL was missing in the first place. I do hope that will help you out. SOAP_before_execute.7z
  9. I did not know until I read your reply that there are dedicated components. I am going to try them. Below is all I set on TIdUDPServer. Actually, I set these at design time and activate component at run-time as in my initial post. TIdUDPServer.Active := False; TIdUDPServer.BroadcastEnable := True; TIdUDPServer.DefaultPort := 8080; Using suggested code, I still get segmentation fault (11) when app exists. However, call stack changed a little this time as in attached screen shot.
  10. ertank

    Need help adding namespaces to SOAP

    There is also a difference of missing empty soap header in Delphi version <soapenv:Header/> You can try creating a soap header and see if it helps. What I do under similar cases is manually creating XML using THTTPRIO.OnBeforeExecute() event. SOAP was using Indy components before. Now it is using THTTPClient in recent versions. Changes presented some bugs like Delphi 10.3.3 version have problem of not reading error message in returned XML if it exists (https://quality.embarcadero.com/browse/RSP-27194). BTW, I do not see any clue about having namespace support for SOAP anywhere.
  11. ertank

    Android service compilation fails

    Hello, Using Delphi 10.3.3. I have no problem compiling Android apps. I just needed to use a service to test something and I failed to compile. Below is error message I receive on a new Android Service project: [Exec Error] The command ""\bin\javac" -d "C:\Users\Ertan\Documents\Embarcadero\Studio\Projects\JavaClasses\Project2" -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\android-support-v4.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\Project2.java .\Android\Debug\Project2ProxyInterface.java" exited with code 3. I have no problem running javac on command prompt C:\Users\Ertan>javac Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are used -classpath <path> Specify where to find user class files and annotation processors -cp <path> Specify where to find user class files and annotation processors -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -endorseddirs <dirs> Override location of endorsed standards path -proc:{none,only} Control whether annotation processing and/or compilation is done. -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process -processorpath <path> Specify where to find annotation processors -parameters Generate metadata for reflection on method parameters -d <directory> Specify where to place generated class files -s <directory> Specify where to place generated source files -h <directory> Specify where to place generated native header files -implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -profile <profile> Check that API used is available in the specified profile -version Version information -help Print a synopsis of standard options -Akey[=value] Options to pass to annotation processors -X Print a synopsis of nonstandard options -J<flag> Pass <flag> directly to the runtime system -Werror Terminate compilation if warnings occur @<filename> Read options and filenames from file C:\Users\Ertan> My version of "javac.exe" is located at C:\Program Files\Java\jdk1.8.0_60\bin\javac.exe I have seen some people having exact same error on my searches. No solution that I could find so far. I am planning to setup a virtual machine to install fresh copy of Delphi 10.3.3 and test if working on it. Before I do that I wonder if there is something I need to check. Thanks & regards, Ertan
  12. ertank

    Android service compilation fails

    That was it. My same registry key was as below: After making it look like same with your settings Android Service compilation works fine. I am not sure how that registry setting value removed in there. BTW, I did also fix 64bit sdk value, too. Thanks.
  13. ertank

    Android service compilation fails

    Here is complete output of messages Build Checking project dependencies... Building Project2.dproj (Debug, Android) brcc32 command line for "Project2.vrc" c:\program files (x86)\embarcadero\studio\20.0\bin\cgrc.exe -c65001 Project2.vrc -foProject2.res [Exec Error] The command ""\bin\javac" -d "C:\Users\Ertan\Documents\Embarcadero\Studio\Projects\JavaClasses\Project2" -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\android-support-v4.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\Project2.java .\Android\Debug\Project2ProxyInterface.java" exited with code 3. Failed Elapsed time: 00:00:00.8 Output Build started 12.01.2020 12:06:25. __________________________________________________ Project "C:\Users\Ertan\Documents\Embarcadero\Studio\Projects\Project2.dproj" (Build target(s)): Target BuildVersionResource: c:\program files (x86)\embarcadero\studio\20.0\bin\cgrc.exe -c65001 Project2.vrc -foProject2.res CodeGear Resource Compiler/Binder Version 1.2.2 Copyright (c) 2008-2012 Embarcadero Technologies Inc. Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 Copyright (C) Microsoft Corporation. All rights reserved. Deleting file "Project2.vrc". Target BuildAndroidServiceJarFile: "\bin\javac" -d "C:\Users\Ertan\Documents\Embarcadero\Studio\Projects\JavaClasses\Project2" -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\android-support-v4.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\Project2.java .\Android\Debug\Project2ProxyInterface.java The system cannot find the path specified. c:\program files (x86)\embarcadero\studio\20.0\bin\CodeGear.Common.Targets(871,5): error MSB3073: The command ""\bin\javac" -d "C:\Users\Ertan\Documents\Embarcadero\Studio\Projects\JavaClasses\Project2" -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\android-support-v4.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\Project2.java .\Android\Debug\Project2ProxyInterface.java" exited with code 3. Done building target "BuildAndroidServiceJarFile" in project "Project2.dproj" -- FAILED. Done building project "Project2.dproj" -- FAILED. Build FAILED. c:\program files (x86)\embarcadero\studio\20.0\bin\CodeGear.Common.Targets(871,5): error MSB3073: The command ""\bin\javac" -d "C:\Users\Ertan\Documents\Embarcadero\Studio\Projects\JavaClasses\Project2" -Xlint:deprecation -classpath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\android-support-v4.jar";"c:\program files (x86)\embarcadero\studio\20.0\lib\Android\Debug\fmx.jar" -bootclasspath "C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidSDK-2525_20.0.36039.7899\platforms\android-26\android.jar" -encoding UTF-8 -target 1.6 -g -source 1.6 .\Android\Debug\Project2.java .\Android\Debug\Project2ProxyInterface.java" exited with code 3. 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.63 I read "The system cannot find the path specified." along the lines. That I presume goes for "\bin\javac" as every other file/directory listed do exist in my system. I am uncertain why. Registry search did not find me anything that I think is relevant. There is no "javac" location setting in SDK settings. I am clueless.
  14. Hello, I am using Delphi 10.3.3. I would like to read caller number right at the time phone is ringing. Edit: I am looking for a solution for Android platform only. Using google, I have found a lot of samples from past about reading call logs, placing calls, etc. I could not find how I should be reading caller number right at the time of a call. Any help is appreciated. Thanks & regards, Ertan
  15. Actually, I did added tags in my initial question, just forgot to mention about that I am only interested in Android platform. I have edited my question and added that information now. Thanks.
  16. Hello, I am using Delphi 10.3.3. For certain reasons I need to use WinInet directly. It has to run on Windows XP and higher versions. I have found below code (slightly changed to compile under my Delphi version) on Stackoverflow by @Remy Lebeau which works good on Windows 7 and higher. procedure WebPostData(const UserAgent: string; const Server: string; const Resource: string; const Data: Pointer; DataSize: UInt32; const ContentType: string; Response: TStream); var hInet: HINTERNET; hHTTP: HINTERNET; hReq: HINTERNET; Heade: string; Buffer: array[0..1023] of Byte; BytesRead: DWORD; const accept: packed array[0..1] of PChar = (PChar('*/*'), nil); begin hInet := InternetOpen(PChar(UserAgent), INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); if not Assigned(hInet) then RaiseLastOSError; try hHTTP := InternetConnect(hInet, PChar(Server), INTERNET_DEFAULT_HTTPS_PORT, nil, nil, INTERNET_SERVICE_HTTP, 0, 1); if not Assigned(hHTTP) then RaiseLastOSError; try hReq := HttpOpenRequest(hHTTP, PChar('POST'), PChar(Resource), nil, nil, @accept, INTERNET_FLAG_SECURE or INTERNET_FLAG_KEEP_CONNECTION, 1); if not Assigned(hReq) then RaiseLastOSError; try Heade := 'User-Agent: ' + UserAgent + #13#10 + 'Accept-Language: en-us,en;q=0.5'#13#10 + 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7'#13#10 + 'Content-Type: ' + ContentType + #13#10 + 'Keep-Alive: 300'#13#10; if not HttpAddRequestHeaders(hReq, PChar(Heade), Length(Heade), HTTP_ADDREQ_FLAG_ADD) then RaiseLastOSError; if not HTTPSendRequest(hReq, nil, 0, Data, DataSize) then RaiseLastOSError; repeat if not InternetReadFile(hReq, @Buffer, SizeOf(Buffer), BytesRead) then RaiseLastOSError; if (BytesRead = 0) then Break; if Response <> nil then Response.WriteBuffer(Buffer, BytesRead); until False; finally InternetCloseHandle(hReq); end; finally InternetCloseHandle(hHTTP); end; finally InternetCloseHandle(hInet); end; end; When I try that code on Windows XP I get below error. System Error. Code: 12157. I do not know if that is possible what I would like to do, but I appreciate any help. Thanks & regards, Ertan
  17. ertank

    Printing Multiple Charts that Span Pages

    I have a friend using ReportBuilder and for export purposes he uses Gnostice PDF Toolkit because ReportBuilder is not capable of building quality and glitch free PDF, PNG, etc files. Gnostice has support for ReportBuilder.
  18. ertank

    Just knowledge

    Add a TMemo on your form. When showing a message, add a line on memo. You will see that order of messages displayed will be same as your code order. You will see messages displayed will be reversed. This is because each message dialog displayed on top of existing one Yes, just test it.
  19. ertank

    Just knowledge

    If application is running on Android, message dialog on that OS is asynchronous. Meaning, they do not block code execution. What happens at run-time, I think is; First dialog displayed first, code continue to execute, second dialog displayed second. However, as second is displayed as the last message, it appeared on top of all others.
  20. ertank

    Git update 5251bc9 broken

    Hello, I am trying to install Indy on a Linux x86_64 using fpcupdeluxe and following line seems broken. /fpcupdeluxe/ccr/indy/Lib/./System/IdGlobal.pas(7536,11) Error: (2021) ENDIF without IF(N)DEF /fpcupdeluxe/ccr/indy/Lib/./System/IdGlobal.pas(7536,11) Error: (2021) ENDIF without IF(N)DEF It is simply missing a $ sign.
  21. ertank

    Git update 5251bc9 broken

    You are most likely to know more than me. I was just trying to get latest version that can be compiled under Linux. I will see if anything I can do though.
  22. ertank

    Git update 5251bc9 broken

    Latest clone as of several minutes ago and IdStackUnix.pas cannot be compiled for Lazarus under Linux x86_64 /fpcupdeluxe/ccr/indy/Lib/./System/IdStackUnix.pas(701,21) Error: (5000) Identifier not found "FIONBIO" /fpcupdeluxe/ccr/indy/Lib/./System/IdStackUnix.pas(1053,40) Error: (5000) Identifier not found "FIONBIO" /fpcupdeluxe/ccr/indy/Lib/./System/IdStackUnix.pas(1058,26) Error: (5000) Identifier not found "EAGAIN" /fpcupdeluxe/ccr/indy/Lib/./System/IdStackUnix.pas(1058,34) Error: (5000) Identifier not found "EWOULDBLOCK" /fpcupdeluxe/ccr/indy/Lib/./System/IdStackUnix.pas(1058,47) Error: (5000) Identifier not found "EINPROGRESS"
  23. ertank

    Git update 5251bc9 broken

    I just used fpcupdeluxe and it seems to be broken on somewhere else now: /fpcupdeluxe/ccr/indy/Lib/./System/IdStack.pas(247,57) Error: (4001) Incompatible types: got "LongInt" expected "LongWord" BTW, this is Linux x86_64 I am trying to build Indy on.
  24. Hello, I am using Delphi 10.3.3 to build an Android 32Bit app running on embedded device with Android 5.1.1 installed. Device has 32Bit CPU and I cannot try to see if building my app for 64Bit helps. There are several operations that app doing in a thread which total takes 6-10 seconds on average. In order to keep user patient, I put a label on screen showing operation is advancing step by step. That label is updated from inside a thread. Thread is started using "TThread.CreateAnonymousThread(<relevant procedure calling code here>).Start()" and Label update code is something as following: TThread.Synchronize(nil, procedure begin StatusUpdateLabel.Text := '1/' + MaxSteps.ToString(); StatusUpdateLabel.Repaint(); end); My initial code did not have that "StatusUpdateLabel.Repaint();" part in above code. Once I started to have that problem, I just try to see if it helps. My case it did not help at all. Label is placed on a TFrame and aligned to Top. Font Family is Default, Size is set to 30, Style is set to Bold. Following is a video I try to put together for better understanding. Try to watch it at full screen. That video displays problem only for 1/9 at the beginning. Problem I am having is with number 1 in that video. That exact problem maybe on number 9, or both 1 and 9 numbers and it maybe in a total different step of the operation. It may happen more than once, too. Interestingly forward slash never has a problem at all. Moreover, I do not always have that problem. It sometimes displays everything as it should be. My guess, depending on internet speed some steps are completed fast. Sometimes pretty fast. When that happens, I get a very tiny text displayed on that Label. I did not have a chance to try reproducing that on a regular mobile phone. Once I find time, I am going to do that for sure. I wonder if that is some kind of a known problem and if there is a way to fix it. Thanks & regards, Ertan thread updated label display problem.mp4
×