Jump to content

Dave Nottage

Members
  • Content Count

    1489
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by Dave Nottage

  1. Dave Nottage

    iOS TLocationSensor crash

    Still no crash. In future, please describe what is in your app when you first ask the question. Please provide a complete, reproducible example, i.e. just enough to reproduce the crash.
  2. Dave Nottage

    iOS TLocationSensor crash

    I'm not having that issue, using the same SDK etc as you. I created a basic app with just a TLocationSensor and a TButton, and set Active to True when clicking the button. Works OK even if no internet connection.
  3. Dave Nottage

    In App Purchase (consumable and subscription)

    As far as I can tell, subscriptions are yet to be supported on iOS, even in 12.2. You may be interested in this article (regarding iOS) - it was written in the Delphi 10.4 era, however the same principles may still apply.
  4. Dave Nottage

    Reading and changing capabilities of Android Camera2 API

    I came across this post whilst looking for something else, and... ..actually, there is a way of achieving this using Delphi code. The following will convert the JObject reference (Obj in your case) to an integer array: function JObjectToIntArray(const AObject: JObject): TArray<Integer>; var LJNIArray: JNIArray; LJNIEnv: PJNIEnv; begin LJNIArray := TJNIResolver.JavaInstanceToID(AObject); SetLength(Result, TJNIResolver.GetArrayLength(LJNIArray)); if Length(Result) > 0 then begin LJNIEnv := TJNIResolver.GetJNIEnv; LJNIEnv^.GetIntArrayRegion(LJNIEnv, LJNIArray, 0, Length(Result), PJNIInt(Result)); TJNIResolver.ExceptionCheck; end; end; For Range<Integer>: var LRange: JRange; LLower, LUpper: Integer; LRange := TJRange.Wrap(Obj); LLower := TJInteger.Wrap(LRange.getLower).intValue; LUpper := TJInteger.Wrap(LRange.getUpper).intValue; It's in Androidapi.JNI.Util. To convert the JObject reference, simply Wrap it: var LRational: JRational; LRational := TJRational.Wrap(Obj);
  5. Dave Nottage

    Delphi FMX SMS Receiver Unable to Retrieve PDU Content

    Probably because that will not work. This should: uses System.TypInfo, Androidapi.JNIBridge; var Obj: JObject; ... Obj := Bundle.get(StringToJString('pdus'); PDUs := TJavaObjectArray<JObject>(WrapJNIArray((Obj as ILocalObject).GetObjectID, TypeInfo(TJavaObjectArray<JObject>))); If there were a complete example, I might be able to test it. Note that you should free PDUs after you are done with it (same for PDU in the other part of your code), as TJavaArray and TJavaObjectArray types are Delphi objects.
  6. Dave Nottage

    Enable Discussions on github ?

    What would you discuss? If you're looking to report an issue, or request an enhancement, use the issues page.
  7. Dave Nottage

    Using Camera in Android 9 under Delphi 12.1 CE

    Without the log messages, or a complete, reproducible example, it's going to be hard to tell.
  8. Dave Nottage

    I cannot get permission for vibrate

    That's only for "dangerous" permissions. It would help to read the entire page I linked to, so you know the difference.
  9. Dave Nottage

    Using Camera in Android 9 under Delphi 12.1 CE

    Have you tried viewing the log messages as per my last reply?
  10. Dave Nottage

    I cannot get permission for vibrate

    When making what? As I said, you do not need to request permission at runtime, just execute the code that does the vibration. If that code is not working, please show your code.
  11. Dave Nottage

    I cannot get permission for vibrate

    You do not need to request the VIBRATE permission at runtime. Just enable it in the Uses Permissions section of the Project Options.
  12. Dave Nottage

    Using Camera in Android 9 under Delphi 12.1 CE

    That's "official" support. Theoretically, Delphi 12 can be used to create apps that run on Android 5 or later. Does the camera not appear at all, or is it once you've taken a photo? If the latter, you should show your code for TakePhotoDidFinishTaking. A complete test case would be even better Just because there's a lot of messages, it does not mean it is not useful. Use filtering to see only relevant messages. This link might help.
  13. Dave Nottage

    Compile&Run cmd for Android

    For .\assets\internal\ on Android, this is incorrect. If a file exists, it will not be overwritten, regardless of whether or not the file is newer.
  14. Dave Nottage

    Compile&Run cmd for Android

    By default? No, it does not. Check that your project does not have the -cleaninstall parameter as per the documentation.
  15. Dave Nottage

    Unable to receive push notification on iOS with FCM

    "Sometimes" seems a bit odd. More than likely you do not have an APNs Key configured in Firebase Console. In the (poorly written) article you linked to, it mentions this at this point: "In the settings section you have to upload the APN certificate that you previously generated on the apple portal in the “Keys” section"
  16. Dave Nottage

    Slow response on TButton click

    You mentioned it later, though:
  17. Dave Nottage

    Start application in system tray

    Two problems: You have - Application.MainFormOnTaskbar := False; Instead of - Application.ShowMainForm := False; ..and you have not assigned anything to the Icon property in the TTrayIcon component, which means it shows as a blank area, rather than a visible icon
  18. That's a separate issue. What device is it? Sadly, this is out of date. The Android SDK Manager will not "open", as per my earlier message (i.e. the UI no longer ships with the SDK) If you install the SDK/NDK via the Manage Features section of the Delphi IDE, you should not need to use it anyway. There are alternatives to installing platform levels and build tools in the SDK, such as via the command line.
  19. Dave Nottage

    Start application in system tray

    Please show your code. Also remember that the Visible property on TTrayIcon needs to be set to True
  20. Dave Nottage

    Start application in system tray

    Yes.. use a TTrayIcon component and set Application.ShowMainForm to False
  21. From the Android SDK? Android have not shipped the SDK Manager UI with the SDK for some time now. If you mean from Delphi, what do you see when you go to Tools | Options, Deployment > SDK Manager?
  22. Dave Nottage

    Android/IOS push notifications...

    You might have missed this part in my original answer: When using the default Delphi implementation, I expect the JSON will be missing the title and body members.
  23. The original installer is broken. If the PC does not have a compatible JDK already installed, it fails to install the SDK and NDK. This has been fixed somewhere between 11.3 and 12.2. The remedy with the "broken" versions is to install the JDK first, with no SDK/NDK, then use Tools | Manage Features to install the SDK/NDK, or install the compatible JDK even before installing Delphi.
  24. Dave Nottage

    Android/IOS push notifications...

    From the example message payload, this is the JSON from the DataObject in StartupNotifications: { "google.delivered_priority": "normal", "google.sent_time": "1735931915894", "google.ttl": "2419200", "google.original_priority": "normal", "google.product_id": "111881503", "body": "Example", "from": "\/topics\/FCMRebooted", "title": "Test", "com.google.firebase.iid.WakeLockHolder.wakefulintent": "true", "google.message_id": "0:1735931916503454%e6375accf9fd7ecd", "google.c.sender.id": "952580923416" }
  25. Dave Nottage

    Slow response on TButton click

    I've tested the same project using Delphi 12.2, deploying to an emulator running Android 8.1 (which is what the Sunmi D2 Mini shipped with), and all respond with the same speed. Perhaps someone with a real device might be able to confirm?
×