-
Content Count
1609 -
Joined
-
Last visited
-
Days Won
36
Posts posted by Dave Nottage
-
-
22 hours ago, CHackbart said:All the buttons on the remote are not detected, except the cursor keys.
That's likely because there's only a few supported, including the arrow keys. This is some code I used a while ago in a TV app, which I have not touched in some time:
type TKeyNavigation = (None, Home, Back, Left, Right, Up, Down, OK); // KeyUp method is overridden from TForm procedure TExampleForm.KeyUp(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState); var LKeyNavigation: TKeyNavigation; LIsTV: Boolean; begin // For the following code, please refer to: // https://github.com/DelphiWorlds/Kastri/blob/c01b93369c2c33f8ab22acad611939be4789aae6/Core/DW.OSDevice.Android.pas#L216 // and: // https://github.com/DelphiWorlds/Kastri/blob/c01b93369c2c33f8ab22acad611939be4789aae6/Core/DW.OSDevice.pas#L34 LIsTV := TOSDevice.GetUIMode = TUIMode.Television; LKeyNavigation := TKeyNavigation.None; case Key of vkHardwareBack, vkEscape: LKeyNavigation := TKeyNavigation.Back; vkleft: LKeyNavigation := TKeyNavigation.Left; vkUp: LKeyNavigation := TKeyNavigation.Up; vkRight: LKeyNavigation := TKeyNavigation.Right; vkDown: LKeyNavigation := TKeyNavigation.Down; 0, vkReturn: begin if KeyChar = #0 then LKeyNavigation := TKeyNavigation.OK; end; end; if FPreventExit and ((Key = vkHardwareBack) or (LIsTV and (Key = vkEscape))) then begin Key := 0; KeyChar := #0; end; if (LKeyNavigation <> TKeyNavigation.None) and LIsTV then KeyNavigation(LKeyNavigation); end; procedure TExampleForm.KeyNavigation(const ANavigation: TKeyNavigation); begin // Use this method to determine what to do with the navigation key end;
Looking at it again now, it probably needs more work.
-
Thanks to a message from @Stewag, I've been prompted to revisit this issue. The following code works on iOS 17. I expect it'll work on iOS 16 - not sure about earlier:
unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} uses Macapi.ObjectiveC, Macapi.Helpers, iOSapi.Foundation, iOSapi.UIKit, iOSapi.Helpers; type UIViewControllerEx = interface(UIViewController) ['{3E6C5FB2-20F2-4B42-BFD8-33968A80E809}'] procedure setNeedsUpdateOfSupportedInterfaceOrientations; cdecl; end; TUIViewControllerEx = class(TOCGenericImport<UIViewControllerClass, UIViewControllerEx>) end; procedure TForm1.Button1Click(Sender: TObject); var LID: Pointer; begin Application.FormFactor.Orientations := [TScreenOrientation.Portrait, TScreenOrientation.InvertedPortrait]; if TOSVersion.Check(16) then begin LID := NSObjectToID(TiOSHelper.SharedApplication.keyWindow.rootViewController); TUIViewControllerEx.Wrap(LID).setNeedsUpdateOfSupportedInterfaceOrientations; end else TUIViewController.OCClass.attemptRotationToDeviceOrientation; end;
If you run the app, then turn the device so that it is in landscape orientation, then click the button, it'll reorient the app into portrait.
-
15 hours ago, philipp.hofmann said:It seems to be different on tablets. I've rent a iPad Pro 11 now for one month and will check if I can reproduce and solve the error there.
Not sure how you will do that - there's no "Display Zoom" option, at least not on my iPad
-
5 hours ago, PascalBertrand said:Has anyone succeeded compiled Netcom7 for android platform. I have a error in nclines.pas : unsatisfied forward or external declaration ?
Moving the procedure TConnectThread.ProcessEvent code out of the MSWINDOWS conditional define (e.g. move it to above the line {$IFDEF MSWINDOWS}) makes that unit compile. I had to also add System.Types to the implementation clause, for the DWord type.
-
-
Memo and html
in FMX
On 4/29/2024 at 10:37 AM, Dave Nottage said:You might be able to modify this code to use TMemo instead of TLabel:
I had a brief look and it appears it may be much more complex with a TMemo
-
7 minutes ago, philipp.hofmann said:"Display&Brightness" > "Display Zoom" -> "More Area" is selected (the alternative is "Standard").
What version of iOS are they running? iOS 16 and iOS 17 both have "Larger Text" and "Default" on my devices. Apps appear to be OK with "Larger Text" on my devices.
-
7 hours ago, zsleo said:The URL on server IIS is https://10.10.1.73
I meant the complete URL, which (assuming you are not using URL rewriting) would need to be something like:
https://10.10.1.73/MyApp/MyServer.dll/GetDecryptedPWD
Where MyApp is the app you added to the website and MyServer.dll is your ISAPI dll. -
7 hours ago, Alisson said:The Delphi IDE returns the following error "Debbuging the application on device running IOS 17 or later is currently not supported."
Best thing you can do for now is to use log statements.
-
7 hours ago, Alisson said:Does anyone have a tip on how I can use the kastri components even using an arm64 simulator?
It seems for the Barcode Reader there are no compatible binaries that can be linked in by Delphi, for iOS simulator. If you're using this feature, you'll need to compile for a real device.
-
4 minutes ago, zsleo said:When running the DLL under IIS the Action 0 always responds correctly to requests but Action 1 always fails with a 404.0.
You don't mention what Path you have for Action 1, and what URL you are using to access it
-
22 hours ago, sp0987 said:...in accordance with project requirements
I've never seen a project requirement that says something like: "the interface section of SysUtils must be modified in this way" - usually it's more like: "functionality X is required", and it may turn out that the most expedient solution to the requirement is to modify the source. Your description sounds a lot like: "we have SysUtils added to the uses clause of (almost) every unit in the project, so let's change that to avoid having to create another one of our own".
25 minutes ago, David Heffernan said:I bet there's another way to solve your problem. If only you'd tell us what the actual problem was.
Amen.
-
1 hour ago, Alisson said:Desconfio que seja algo relacionado as bibliotecas Kastri master. Tenho outro app que não possui a biblioteca e funciona normalmente no IOS Simulator ARM 64 bits
Which features from Kastri are you compiling? You may just need to change the value in the Framework search paths setting in the Project Options to point to the Simulator binaries, if any are available.
-
Memo and html
in FMX
16 hours ago, xorpas said:How can Make memo support html that show readable text ?
You might be able to modify this code to use TMemo instead of TLabel:
https://github.com/grijjy/CodeRage2019/tree/master/HtmlLabel-
1
-
-
8 hours ago, Alisson said:Estou utilizando delphi 11.3 com um macbook air 2022 m1 e continua ocorrendo a situação.
What exactly is the error message you are seeing?
-
Just now, Rollo62 said:I assumed that XCode 15 won't support or can handle older iOS 16.x SDKs any longer.
Xcode 15 doesn't have iOS 16.x SDKs, no.. but that does not mean you cannot debug iOS 16 (or earlier) devices.
1 minute ago, Rollo62 said:Can you confirm that XCode 15 can still be used for debugging same as XCode 14.3.1, under iOS 16.x, without too much trickery ?
With no "trickery" whatsoever. iOS 16.x devices do not have the new debugging support introduced in iOS 17, and Xcode 15 handles that.
7 minutes ago, Rollo62 said:The older SDK will have to be hooked into XCode manually, with all possible incompatibilities.
Not sure what you mean by "manually". The only "incompatibilities" are if you attempt to use features in code available in the newer SDK on a device with an older OS (when the feature is not available in that older OS).
9 minutes ago, Rollo62 said:Older iOS SDKs are not directly available through official channels.
They must be extracted from an older Xcode version.That's true, however you can import an iOS 17.x SDK from Xcode 15, build your app against it, and It will happily run on an iOS 16.x device (as long as you do not attempt to use features from a newer OS, as mentioned above), and you can use the debugger with Delphi. As I mentioned earlier, it's debugging with an iOS 17.x device that is the major issue right now.
-
12 hours ago, Rollo62 said:Would be great if there is a way, to make XCode 15 compatible with Delphi, or vice versa.
Delphi can already use Xcode 15. The biggest issue at the moment is debugging with iOS 17 (or higher) devices, which is a problem regardless of Xcode version. Debugging on devices with iOS 16.x still works using Xcode 15. A secondary issue is this one: a problem if your app needs to link to 3rd party binaries that were built with Xcode 14 or higher.
-
2
-
-
6 hours ago, DominikR said:I am using a Pixel 8 with Android 14.
Not sure what the problem is - it works fine on my Pixel 6 Pro with Android 14. Perhaps try a clean/build.
-
3 hours ago, DominikR said:This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
What version of Android is on your device, and what make/model of device is it?
-
2 hours ago, nevez said:Whilte tryinh it on a real device with android64 bit the application freezes on the white screen while opening.
Does this happen for you with a blank application? If not, it would help to have a sample app that "freezes" like you're describing.
-
11 hours ago, Keesver said:'m using class TLocalReceiver from a Kastri sample application. When I create a new instance from this class I run into an exception:
If you're using a demo app, you should not receive that error. The Java type comes from a java library from the Lib folder in Kastri, and which one will depend on the version of Delphi you are using.
- Delphi 10.x: dw-kastri-base.jar
- Delphi 11.x: dw-kastri-base-2.0.0.jar
- Delphi 12.x: dw-kastri-base-3.0.0.jar
The relevant jar file would have been added to the Libraries node of the Android 32-bit target in Project Manager, e.g (Delphi 12.x):
Which should be compiled in with the app, unless you're using Delphi 11.3, which requires a workaround.
-
5 hours ago, nevez said:What should I do ?
Use one that works with the version of Delphi you're using. Either use Tools | Manage Features (in the Delphi menu) and select the Android SDK/NDK, or download a compatible NDK from the NDK downloads. r21e looks like it might work: https://github.com/android/ndk/wiki/Unsupported-Downloads#r21e
-
-
3 hours ago, Dave Nottage said:If so, I'll revisit this since I haven't looked at it since upgrading to 12.1.
I revisited it anyway, and have attached the updated test project. Using Codex 2.2.0 I downloaded the AndroidX appcompat package (note that it should be v1.2.0 to align with what Delphi 12.1 uses):
..and added it using the Add Android Package menu item that Codex adds to the Project Manager context menu. This is after deploying at least once, so that resources are merged properly.In Delphi 12.1 deploying at least once also means that AndroidManifest.template.xml is created (in 12.0 and earlier it is created when building, rather than deploying), and the following is added to it, just before <%activity%>:
<activity android:name="com.delphiworlds.kastri.DWFilesActivity" android:excludeFromRecents="true" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:mimeType="*/*" /> <data android:scheme="content" /> <data android:host="*" /> </intent-filter> </activity>
..and of course, the dw.filesactivity.jar library is added to the Android 32-bit Libraries node (does not need to be added to 64-bit unless you're using Delphi 11.3)
Code for getting permissions not working in Delphi 11
in FMX
Posted
This:
Needs to be:
I believe the change to the types was related to C++Builder compatibility