-
Content Count
1296 -
Joined
-
Last visited
-
Days Won
29
Everything posted by Dave Nottage
-
Execute external program/command and capture output
Dave Nottage replied to softtouch's topic in Cross-platform
I don't have any concrete examples as yet, however there is this: https://github.com/DelphiWorlds/Kastri/blob/master/Core/DW.RunProcess.Mac.pas -
About 4 weeks ago I submitted an update to an app for review on Google Play Store and it took 4 days. After 2 days I queried the delay (which was unusual because the previous updates were available within hours) and they replied that such delays occur from time to time.
-
Exactly. There should be an option in the Version Info to override what the IDE defaults to (currently 30). I've now added this report to the Quality Portal: https://quality.embarcadero.com/browse/RSP-38976
-
Replicating a routine that uses OpenSSL to use another library
Dave Nottage posted a topic in RTL and Delphi Object Pascal
I'd like to be able to remove a dependency on OpenSSL, which is being used in this routine (original context here😞 class function TgoSSLHelper.Sign_RSASHA256(const AData: TBytes; const APrivateKey: TBytes; out ASignature: TBytes): Boolean; var BIOPrivateKey: PBIO; PrivateKey: PEVP_PKEY; Ctx: PEVP_MD_CTX; SHA256: PEVP_MD; Size: Cardinal; begin BIOPrivateKey := BIO_new_mem_buf(@APrivateKey[0], Length(APrivateKey)); PrivateKey := PEM_read_bio_PrivateKey(BIOPrivateKey, nil, nil, nil); Ctx := EVP_MD_CTX_create; try SHA256 := EVP_sha256; if (EVP_DigestSignInit(Ctx, nil, SHA256, nil, PrivateKey) > 0) and (EVP_DigestUpdate(Ctx, @AData[0], Length(AData)) > 0) and (EVP_DigestSignFinal(Ctx, nil, Size) > 0) then begin SetLength(ASignature, Size); Result := EVP_DigestSignFinal(Ctx, @ASignature[0], Size) > 0; end else Result := False; finally EVP_MD_CTX_destroy(Ctx); end; end; I'm a bit green when it comes to cryptography routines, so I'm not exactly sure what it is doing, and the OpenSSL docs are quite verbose, however my goal is to be able to use another library like LockBox, or DCPCrypt (if it can handle it) so as to remove the dependency on OpenSSL. Can someone help replicate it using LockBox3 or perhaps some other (non-commercial) library, or at least point to which classes should be used? -
Replicating a routine that uses OpenSSL to use another library
Dave Nottage replied to Dave Nottage's topic in RTL and Delphi Object Pascal
Thanks, however I'm after something that is cross-platform. -
The message would be that you need to target API level 31 or more. As pcplayer99 inferred, you will need to modify your AndroidManifest.template.xml, by replacing %targetSdkVersion% with the value: 31. You will also need to add an android:exported="true" attribute to the application node in the same file, so that it looks like this: <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" android:label="%activityLabel%" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:exported="true" android:launchMode="singleTask"> If you changed your SDK settings in Delphi SDK Manager to use API level 31, you should change them back to API level 30 unless you want to be stuck with other problems in the manifest (when compiling the app)
-
Use OnCloseQuery in the main form, and prevent the main form from closing unless the "exit" form has already been shown. If it hasn't been shown, show it 🙂
-
Is it true that using FMX units will cause android apps to fail?
Dave Nottage replied to KMarb's topic in FMX
You cannot use FMX.xxx units in an Android service built with Delphi. See: https://quality.embarcadero.com/browse/RSP-17857 -
Your Android device does not support the selected target platform architecture
Dave Nottage replied to alogrep's topic in FMX
Some devices have 64-bit CPUs, but have Android 32-bit running on them. Easiest way to find out if this is the case for you is to download an app like this. On the CPU page it reports whether the device is running in 32-bit mode. -
Can Delphi 11 IDE handle debugging two Android phones at the same time?
Dave Nottage replied to Al T's topic in Delphi IDE and APIs
Fair enough - I'd first try 2 instances of Delphi as SwiftExpat has suggested (have you tried this?), otherwise if that's too problematic: the second instance running in a Virtual Machine. -
[Solved](Delphi 11) (Android 12) 32-bit Debug Segment Fault 11 (TFile.Copy?)
Dave Nottage replied to Al T's topic in FMX
More to it than that: Updating the label (or anything UI related) needs to happen in the main thread - see Rollo62's answer- 5 replies
-
- delphi
- alexandria
-
(and 3 more)
Tagged with:
-
Multiplatform Hello World error [PAClient Error] Error: E7688
Dave Nottage replied to alogrep's topic in FMX
Looks like you may be using a project created with an older version of Delphi. Please refer to: https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AndroidLibraries -
[Solved](Delphi 11) (Android 12) 32-bit Debug Segment Fault 11 (TFile.Copy?)
Dave Nottage replied to Al T's topic in FMX
I'd expect that behaviour if CopyData was running in a separate thread. It would not normally be an issue, otherwise.- 5 replies
-
- delphi
- alexandria
-
(and 3 more)
Tagged with:
-
Can Delphi 11 IDE handle debugging two Android phones at the same time?
Dave Nottage replied to Al T's topic in Delphi IDE and APIs
I doubt it is possible with one instance of Delphi. Might be better to explain why you need it - there may be an alternative. -
Keeping edit field in view when on-screen keyboard appears
Dave Nottage replied to KMarb's topic in FMX
There's this (outdated) article. The demo has moved to here, and it sorely needs another revisit 🙂 -
Your repo violates copyright, by including a near copy of System.Zip (apparently from an earlier version of Delphi)
-
Is there any reason why you can't download to an app-specific folder? There are a number of changes in Android 11 that make it difficult to manage storage in shared folders: https://developer.android.com/about/versions/11/privacy/storage Which would explain why you are having issues. If you're logging from an app, the easiest way is to use Log.d from the FMX.Types unit. You can view the log messages using a logcat viewer - I have one called Device Lens. In Delphi, there's a permission in the Uses Permissions > Signature section of the Project Options called "Request install packages". Even with that checked, the OS might request approval from the user.
-
This is a complete routine that should work: procedure OpenApplication(const AFileName: string); var LMimeType: JString; LIntent: JIntent; begin LMimeType := TJMimeTypeMap.JavaClass.getSingleton.getMimeTypeFromExtension(StringToJString('apk')); LIntent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_VIEW); LIntent.setDataAndType(JFileToJURI(TJFile.JavaClass.init(StringToJString(AFileName))), LMimeType); LIntent.setFlags(TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION); TAndroidHelper.Activity.startActivityForResult(LIntent, 999); // 999 is just a random value - it won't matter what it is end; Note the extra line regarding FLAG_GRANT_READ_URI_PERMISSION.
-
Sorry.. missed a step. Delete AndroidManifest.template.xml in the project folder. The IDE will recreate this. If you have made any customisations to it, you will need to ensure you reinstate those after it is recreated.
-
This should be: Intent.setDataAndType(JFileToJURI(F)), StringToJString('application/vnd.android.package-archive')); JFileToJURI uses the FileProvider class to create the correct URI You won't need to do that if you check the Secure File Sharing option in the Entitlements List in the Project Options. This also creates and deploys the required xml file.
-
Their blog site appears to be still alive: https://components4developers.blog ..and Kim is still posting on Twitter (at least less than 2 weeks ago): https://twitter.com/comp4dev
-
Delphi 10.4.2 won't open a specific .PAS file
Dave Nottage replied to MJBComp's topic in Delphi IDE and APIs
How big is the file? It might have some odd characters in it that the IDE cannot handle? Or maybe some peculiar structure? For the characters problem: try loading it in Notepad, make a minor change, then save it, then load it in Delphi again. -
You do not indicate what library you are using. Is it this one (or similar)? https://github.com/jimmckeeth/FireMonkey-Android-Voice Where you have "impossible to do something", you do not indicate exactly what it is your code is doing. Nor do you show what it is doing in the timer handler. Given that code executes, it's quite possible that the SpeechRecognition1Recognition event is executing outside of the main thread, which may account for the other issues you are seeing. If that is the case, you could use a construct like this: procedure TForm1.SpeechRecognition1Recognition(Sender: TObject; Guess: string); begin TThread.Synchronize(nil, procedure begin G_Heard := Guess; // Execute your other code, here end ); end;
-
Get copyright info from code in macOS
Dave Nottage replied to Nicolò Blunda's topic in Cross-platform
It seems it is not included by default in macOS apps produced by Delphi. When it is included, you could use the following code: Value := NSStrToStr(TNSString.Wrap(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle, StringToID('NSHumanReadableCopyright')))); -
HELP: How to build blank Android App with trial Delphi 11
Dave Nottage replied to vladvash's topic in Cross-platform
It looks like a JDK compatibility issue. Start with showing what your Java settings are in Delphi, i.e. Tools | Options, Deployment > SDK Manager, select the relevant Android SDK, and select the Java tab. Mine looks like this: