Jump to content

Dave Nottage

Members
  • Content Count

    1490
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by Dave Nottage

  1. Dave Nottage

    Run a form on application exit??

    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 🙂
  2. You cannot use FMX.xxx units in an Android service built with Delphi. See: https://quality.embarcadero.com/browse/RSP-17857
  3. 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.
  4. 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.
  5. More to it than that: Updating the label (or anything UI related) needs to happen in the main thread - see Rollo62's answer
  6. Dave Nottage

    Multiplatform Hello World error [PAClient Error] Error: E7688

    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
  7. I'd expect that behaviour if CopyData was running in a separate thread. It would not normally be an issue, otherwise.
  8. I doubt it is possible with one instance of Delphi. Might be better to explain why you need it - there may be an alternative.
  9. Dave Nottage

    Keeping edit field in view when on-screen keyboard appears

    There's this (outdated) article. The demo has moved to here, and it sorely needs another revisit 🙂
  10. Dave Nottage

    Gradle support for Android

    Your repo violates copyright, by including a near copy of System.Zip (apparently from an earlier version of Delphi)
  11. Dave Nottage

    Self-updating android app in Alexandria

    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.
  12. Dave Nottage

    Self-updating android app in Alexandria

    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.
  13. Dave Nottage

    Self-updating android app in Alexandria

    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.
  14. Dave Nottage

    Self-updating android app in Alexandria

    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.
  15. Dave Nottage

    Components4developers???

    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
  16. Dave Nottage

    Delphi 10.4.2 won't open a specific .PAS file

    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.
  17. Dave Nottage

    [Android] App does not answer anymore

    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;
  18. Dave Nottage

    Get copyright info from code in macOS

    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'))));
  19. 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:
  20. Dave Nottage

    MacOS: How to remove ambiguous Developer ID certificates?

    As ginnix suggests, this is because the ambiguous certificates are in the Keychain on your machine. In the Applications/Utilities folder there is an application called Keychain Access. Run that, select the "login" keychain on the left hand side, and select the "My Certificates" tab. Delete all the ambiguous Developer ID certificates except for the one with the latest expiry date, by right-clicking each one and clicking "Delete"
  21. Dave Nottage

    How to create an Android app

    Tools > Manage Platforms
  22. It was a totally new app. I uploaded an .aab file generated from the IDE in App Store configuration. The keystore file was also generated in the IDE on the Provisioning Page. I did not have to do the things you described - I guess the IDE manages that?
  23. Quite odd - I haven't had to to that (I submitted a release just over 2 weeks ago), and haven't heard of anyone else that has needed to, either.
  24. Dave Nottage

    iPhoneOS15.X.sdk

    I'd be interested to know if it passes review.
  25. Dave Nottage

    Printing from Android Device

    There can be solutions; just that there isn't any included with Delphi. This is a potential starting point: https://developer.android.com/training/printing, though you will need knowledge of Java, and how to convert the code to Delphi. If you mean development tools other than Delphi, there could be solutions using those, however it may still require writing the same code as per the link mentioned above, i.e. it would be unlikely to be included with the development tool itself.
×