-
Content Count
1491 -
Joined
-
Last visited
-
Days Won
36
Everything posted by Dave Nottage
-
android Delphi Android Intent while App is active creates black screen
Dave Nottage replied to DominikR's topic in FMX
Not sure what the problem is - it works fine on my Pixel 6 Pro with Android 14. Perhaps try a clean/build. -
android Delphi Android Intent while App is active creates black screen
Dave Nottage replied to DominikR's topic in FMX
What version of Android is on your device, and what make/model of device is it? -
android Delphi 12.1 Android API 34 - not support architecture
Dave Nottage replied to nevez's topic in General Help
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.- 12 replies
-
- rad studio
- platform
-
(and 2 more)
Tagged with:
-
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): <snip> Which should be compiled in with the app, unless you're using Delphi 11.3, which requires a workaround.
-
android Delphi 12.1 Android API 34 - not support architecture
Dave Nottage replied to nevez's topic in General Help
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- 12 replies
-
- rad studio
- platform
-
(and 2 more)
Tagged with:
-
TWebBrowser + dynamic JS question
Dave Nottage replied to David Schwartz's topic in Network, Cloud and Web
Please see this link. -
android Delphi Android Intent while App is active creates black screen
Dave Nottage replied to DominikR's topic in FMX
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) RSP41337.zip -
TWebBrowser + dynamic JS question
Dave Nottage replied to David Schwartz's topic in Network, Cloud and Web
Is this on Windows? If so, are you setting the WindowsEngine property of the TWebBrowser to EdgeOnly? The result you're seeing happens if TWebBrowser uses IE. -
android Delphi Android Intent while App is active creates black screen
Dave Nottage replied to DominikR's topic in FMX
Are you using the latest released version? i.e. Codex 2.2.0? If so, I'll revisit this since I haven't looked at it since upgrading to 12.1. -
TWebBrowser + dynamic JS question
Dave Nottage replied to David Schwartz's topic in Network, Cloud and Web
There is no Document property, however there is a way of accessing the underlying web view (ICoreWebView2 on Windows, JWebView on Android and WKWebView on macOS/iOS), e.g. on Android: var LWebView: JWebView; begin if Supports(WebBrowser1, JWebView, LWebView) then // Do something with LWebView end; That said, as time goes on the underlying web view (on all platforms) has had direct access to HTML removed, so it has become necessary to execute JavaScript to achieve the same thing. Unfortunately, TWebBrowser has only EvaluateJavascript, which does not support returning a result, so it's necessary to use the technique above to achieve this, as I've done in the WebBrowserExt feature in Kastri (demo here). Using TWebBrowserExt, ExecuteJavaScript could be called with cJavaScriptGetPageContents (from the DW.JavaScript unit), thus: 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.WebBrowser, FMX.Controls.Presentation, FMX.StdCtrls, DW.WebBrowserExt; type TForm1 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; procedure Button1Click(Sender: TObject); procedure WebBrowser1DidFinishLoad(ASender: TObject); private FWebBrowserExt: TWebBrowserExt; public constructor Create(AOwner: TComponent); override; end; var Form1: TForm1; implementation {$R *.fmx} uses DW.JavaScript; { TForm1 } constructor TForm1.Create(AOwner: TComponent); begin inherited; WebBrowser1.WindowsEngine := TWindowsEngine.EdgeOnly; // On Windows, unlikely to work with IE FWebBrowserExt := TWebBrowserExt.Create(WebBrowser1); end; procedure TForm1.WebBrowser1DidFinishLoad(ASender: TObject); begin FWebBrowserExt.ExecuteJavaScript(cJavaScriptGetPageContents, procedure(const AJavaScriptResult: string; const AErrorCode: Integer) begin // AJavaScriptResult should now contain the page contents end ); end; procedure TForm1.Button1Click(Sender: TObject); begin WebBrowser1.Navigate('http://help.websiteos.com/websiteos/example_of_a_simple_html_page.htm'); end; end. Not sure whether that answer was wrong in 2017, but it's certainly incomplete now, given the above. -
Does this mean you've moved on from attempting to generate a custom classes.dex? Going by their documentation, the init method needs to be called. (the one that takes a Context and a ScannerResult as parameters). This may present a problem because Delphi uses init as a method name for Java constructors, and XcBarcodeScanner has its own static method called init (which is not a constructor), so the JNI code may actually try and find a constructor method (and fail) rather than the actual method called init. I'm not sure if there's a solution for this yet, other than writing Java code of your own (that you would call from Delphi) that uses the XcBarcodeScanner class. Incidentally, I've managed to acquire the .jar file myself using information from the Github link you gave.
-
I've tried searching for this with not much success. Do you have a link?
-
What is the jar file, and is there some reason why just adding the jar to the project is not sufficient?
-
Why there is no line number in debug information (using JclDebug)
Dave Nottage replied to Wagner Landgraf's topic in RTL and Delphi Object Pascal
In your unit, is there a debug info directive? i.e. if you have {$D-} or {$DebugInfo Off}, it will not include debug info. -
What kind of Mac do you have? i.e. is it an M1 or M2, or an Intel-based Mac?
-
Delphi 11, Android, deploy .db file, will not overwrite previous
Dave Nottage replied to Fudley's topic in FMX
Overwrite can be somewhat misleading. It refers to what happens when the file is deployed from the local file to the application package, not whether the file is overwritten when the app starts - this process occurs in the System.StartUpCopy unit (in the rtl\common folder of the Delphi source), and as evidenced by line 83 (at least in Delphi 12.1): if not FileExists(DestFileName) then //do not overwrite files ..when the files are put in their final destination, if the file exists it is not overwritten. A couple of possible workarounds: 1. Patch the System.StartUpCopy unit so that it does overwrite 2. Use files with "versioned" filenames, e.g. fudley-1.0.0.db, and replace the entry in the deployment with the new version. In your apps startup code, look for files using pattern matching, e.g: uses System.IOUtils; procedure TForm1.FormCreate(Sender: TObject); var LDBFiles: TArray<string>; begin LDBFiles := TDirectory.GetFiles(TPath.GetDocumentsPath, 'fudley-*.db', TSearchOption.soTopDirectoryOnly); // If there's only ever one file, it should be the value in LDBFiles[0], so rename that to fudley.db end; -
Does it work if starting a completely blank app, and putting a TEdit on the form? It works OK here
-
Same thing happened to me re Ios Island 🙂 Following the live activities link leads to: https://developer.apple.com/documentation/ActivityKit/displaying-live-data-with-live-activities Which talks about using Widget Extensions, which are yet to be possible in Delphi, however there's a slim chance that the extension can "talk" to Delphi code: https://blog.grijjy.com/2018/11/15/ios-and-macos-app-extensions-with-delphi/ I have very little optimism about the possibility
-
Correct - I have reported this nearly 2 years ago: https://quality.embarcadero.com/browse/RSP-38976
-
targetSdkVersion refers to the highest API level that your app can target, not which API level in your SDK that you built against. If Play Store says your app targets API level 32, check AndroidManifest.xml in the project output folder for which you built the app for Play Store. You may just need to do a clean and rebuild to ensure that AndroidManifest.xml is updated.
-
This says otherwise: https://blogs.embarcadero.com/delphi-supports-android-api-33-via-yukon-beta/ Please see also:
-
No - the Alcinoe implementation is based on the old ExoPlayer (in the com.google.android.exoplayer2 namespace). I am working on an implementation that uses Media3, but only just today have experimental code working that plays a video from a nominated URI.
-
https://stackoverflow.com/a/36041595/3164070
-
Browsing outside of the application itself requires intents. You could use Kastri, which has this Files Selector demo.
-
A better way to share global data structures than as global variables?
Dave Nottage replied to DavidJr.'s topic in Algorithms, Data Structures and Class Design
Straight Outta ChatGPT