-
Content Count
1491 -
Joined
-
Last visited
-
Days Won
36
Everything posted by Dave Nottage
-
I've seen another developer have this issue - he has talked with an engineer from Embarcadero and they are yet to find what the problem is. This is something new. Best I can suggest is to report the issues to https://quality.embarcadero.com/
-
EUnsupportedPlatformService with message 'Unsupported platform service: Terminate'
Dave Nottage replied to at3s's topic in FMX
Did you read this? Did you also read this? -
compiling DCU without creating EXE
Dave Nottage replied to Dave Novo's topic in RTL and Delphi Object Pascal
In my case, it still generates DCUs. (but yes, the "c" is not needed). Regardless, my goal of having a kind of "compile check" was achieved I lived in hope that it was able to work out something that I couldn't 😉 -
compiling DCU without creating EXE
Dave Nottage replied to Dave Novo's topic in RTL and Delphi Object Pascal
Not sure when it was added, but this compiler option appears to just compile (i.e. omits the linking phase): -Jc I discovered this after probing ChatGPT for an answer. The reason why I'm using this option is because I want my CI to just do a compile check in case there's been any boneheaded mistakes in the code, without having it linking to SDKs or other binaries (which can take ages) Jc = "Just compile"? 😉 -
You need to update Xcode, and import the iOS 16.1 SDK. Xcode 14.1 requires at least macOS Monterey 12.5
-
You can use Apple Push Services, but it's for iOS only. You don't give any details about how you're sending it, or what you are sending. Are you following the documentation, here? https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns?language=objc Also, have you enabled Push Notifications for the App ID that is used in the Provisioning Profile for the application? Please refer to: https://blog.grijjy.com/2017/01/31/receiving-push-notifications-from-apples-push-notification-and-googles-firebase-cloud-messaging-services/
-
Application fail to start on android 10-11-12-13 IMEI
Dave Nottage replied to Maher Tannous's topic in FMX
There is no reliable way of uniquely identifying a specific Android device. If you were able to do this, what would be the process for ensuring that the IMEI is correct? Would the identifier be hard-coded into the app itself, or would there be some other measure external to the application? -
In what location? Please provide the exact error message.
-
Probably because his answer is for memory, not storage. If you're after the latter, there's an answer in Java here that should be relatively easily translated. Some time ago I added an import for the relevant classes (Environment and StatFs) in this unit, but I'll repeat the code just for those classes if that's all you are looking for: JEnvironmentClass = interface(JObjectClass) ['{847171A2-7B65-4251-9BD3-E0BC89DE31FD}'] {class} function _GetDIRECTORY_ALARMS: JString; cdecl; {class} procedure _SetDIRECTORY_ALARMS(Value: JString); cdecl; {class} function _GetDIRECTORY_AUDIOBOOKS: JString; cdecl; {class} procedure _SetDIRECTORY_AUDIOBOOKS(Value: JString); cdecl; {class} function _GetDIRECTORY_DCIM: JString; cdecl; {class} function _GetDIRECTORY_DOCUMENTS: JString; cdecl; {class} function _GetDIRECTORY_DOWNLOADS: JString; cdecl; {class} procedure _SetDIRECTORY_DOWNLOADS(Value: JString); cdecl; {class} function _GetDIRECTORY_MOVIES: JString; cdecl; {class} function _GetDIRECTORY_MUSIC: JString; cdecl; {class} procedure _SetDIRECTORY_MUSIC(Value: JString); cdecl; {class} function _GetDIRECTORY_NOTIFICATIONS: JString; cdecl; {class} procedure _SetDIRECTORY_NOTIFICATIONS(Value: JString); cdecl; {class} function _GetDIRECTORY_PICTURES: JString; cdecl; {class} function _GetDIRECTORY_PODCASTS: JString; cdecl; {class} procedure _SetDIRECTORY_PODCASTS(Value: JString); cdecl; {class} function _GetDIRECTORY_RINGTONES: JString; cdecl; {class} function _GetDIRECTORY_SCREENSHOTS: JString; cdecl; {class} procedure _SetDIRECTORY_SCREENSHOTS(Value: JString); cdecl; {class} function _GetMEDIA_BAD_REMOVAL: JString; cdecl; {class} function _GetMEDIA_CHECKING: JString; cdecl; {class} function _GetMEDIA_EJECTING: JString; cdecl; {class} function _GetMEDIA_MOUNTED: JString; cdecl; {class} function _GetMEDIA_MOUNTED_READ_ONLY: JString; cdecl; {class} function _GetMEDIA_NOFS: JString; cdecl; {class} function _GetMEDIA_REMOVED: JString; cdecl; {class} function _GetMEDIA_SHARED: JString; cdecl; {class} function _GetMEDIA_UNKNOWN: JString; cdecl; {class} function _GetMEDIA_UNMOUNTABLE: JString; cdecl; {class} function _GetMEDIA_UNMOUNTED: JString; cdecl; {class} function init: JEnvironment; cdecl; {class} function getDataDirectory: JFile; cdecl; {class} function getDownloadCacheDirectory: JFile; cdecl; {class} function getExternalStorageDirectory: JFile; cdecl; {class} function getExternalStoragePublicDirectory(&type: JString): JFile; cdecl; {class} function getExternalStorageState: JString; cdecl; overload; {class} function getExternalStorageState(path: JFile): JString; cdecl; overload; {class} function getRootDirectory: JFile; cdecl; {class} function getStorageState(path: JFile): JString; cdecl; {class} function getStorageDirectory: JFile; cdecl; // **** Android 11 **** {class} function isExternalStorageEmulated: Boolean; cdecl; overload; {class} function isExternalStorageEmulated(path: JFile): Boolean; cdecl; overload; {class} function isExternalStorageLegacy: Boolean; cdecl; overload; // **** Android 10 **** {class} function isExternalStorageLegacy(path: JFile): Boolean; cdecl; overload; // **** Android 10 **** {class} function isExternalStorageManager: Boolean; cdecl; overload; // **** Android 11 **** {class} function isExternalStorageManager(path: JFile): Boolean; cdecl; overload; // **** Android 11 **** {class} function isExternalStorageRemovable: Boolean; cdecl; overload; {class} function isExternalStorageRemovable(path: JFile): Boolean; cdecl; overload; {class} property DIRECTORY_ALARMS: JString read _GetDIRECTORY_ALARMS write _SetDIRECTORY_ALARMS; {class} property DIRECTORY_AUDIOBOOKS: JString read _GetDIRECTORY_AUDIOBOOKS write _SetDIRECTORY_AUDIOBOOKS; // **** Android 10 **** {class} property DIRECTORY_DCIM: JString read _GetDIRECTORY_DCIM; {class} property DIRECTORY_DOCUMENTS: JString read _GetDIRECTORY_DOCUMENTS; {class} property DIRECTORY_DOWNLOADS: JString read _GetDIRECTORY_DOWNLOADS write _SetDIRECTORY_DOWNLOADS; {class} property DIRECTORY_MOVIES: JString read _GetDIRECTORY_MOVIES; {class} property DIRECTORY_MUSIC: JString read _GetDIRECTORY_MUSIC write _SetDIRECTORY_MUSIC; {class} property DIRECTORY_NOTIFICATIONS: JString read _GetDIRECTORY_NOTIFICATIONS write _SetDIRECTORY_NOTIFICATIONS; {class} property DIRECTORY_PICTURES: JString read _GetDIRECTORY_PICTURES; {class} property DIRECTORY_PODCASTS: JString read _GetDIRECTORY_PODCASTS write _SetDIRECTORY_PODCASTS; {class} property DIRECTORY_RINGTONES: JString read _GetDIRECTORY_RINGTONES; {class} property DIRECTORY_SCREENSHOTS: JString read _GetDIRECTORY_SCREENSHOTS write _SetDIRECTORY_SCREENSHOTS; // **** Android 10 **** {class} property MEDIA_BAD_REMOVAL: JString read _GetMEDIA_BAD_REMOVAL; {class} property MEDIA_CHECKING: JString read _GetMEDIA_CHECKING; {class} property MEDIA_EJECTING: JString read _GetMEDIA_EJECTING; {class} property MEDIA_MOUNTED: JString read _GetMEDIA_MOUNTED; {class} property MEDIA_MOUNTED_READ_ONLY: JString read _GetMEDIA_MOUNTED_READ_ONLY; {class} property MEDIA_NOFS: JString read _GetMEDIA_NOFS; {class} property MEDIA_REMOVED: JString read _GetMEDIA_REMOVED; {class} property MEDIA_SHARED: JString read _GetMEDIA_SHARED; {class} property MEDIA_UNKNOWN: JString read _GetMEDIA_UNKNOWN; {class} property MEDIA_UNMOUNTABLE: JString read _GetMEDIA_UNMOUNTABLE; {class} property MEDIA_UNMOUNTED: JString read _GetMEDIA_UNMOUNTED; end; [JavaSignature('android/os/Environment')] JEnvironment = interface(JObject) ['{8A8591BC-BC01-4338-91D8-2671DAB231F8}'] end; TJEnvironment = class(TJavaGenericImport<JEnvironmentClass, JEnvironment>) end; JStatFsClass = interface(JObjectClass) ['{F97A99DF-CDC1-4842-80F2-2EA53A906E3E}'] {class} function init(path: JString): JStatFs; cdecl; end; [JavaSignature('android/os/StatFs')] JStatFs = interface(JObject) ['{C34856EE-443F-42CB-B25B-DEC0B8C938D0}'] function getAvailableBlocks: Integer; cdecl; function getAvailableBlocksLong: Int64; cdecl; function getAvailableBytes: Int64; cdecl; function getBlockCount: Integer; cdecl; function getBlockCountLong: Int64; cdecl; function getBlockSize: Integer; cdecl; function getBlockSizeLong: Int64; cdecl; function getFreeBlocks: Integer; cdecl; function getFreeBlocksLong: Int64; cdecl; function getFreeBytes: Int64; cdecl; function getTotalBytes: Int64; cdecl; procedure restat(path: JString); cdecl; end; TJStatFs = class(TJavaGenericImport<JStatFsClass, JStatFs>) end;
-
Application fail to start on android 10-11-12-13 IMEI
Dave Nottage replied to Maher Tannous's topic in FMX
Yes, this value can no longer be accessed by regular apps on Android since version 10. It might help to know why you need this value -
Is the original question about retrieving local IP addresses? This code still works for me with a target SDK of 31+: uses IdStack; procedure GetLocalAddressList(const AAddresses: TIdStackLocalAddressList); implementation uses System.SysUtils, Androidapi.JNI.Java.Net, Androidapi.JNI.JavaTypes, Androidapi.Helpers, Androidapi.JNIBridge, IdGlobal; procedure GetLocalAddressList(const AAddresses: TIdStackLocalAddressList); var LInterfaces, LAddresses: JEnumeration; LInterface: JNetworkInterface; LAddress: JInetAddress; LName, LHostAddress: string; begin AAddresses.Clear; LInterfaces := TJNetworkInterface.JavaClass.getNetworkInterfaces; while LInterfaces.hasMoreElements do begin LInterface := TJNetworkInterface.Wrap(LInterfaces.nextElement); LAddresses := LInterface.getInetAddresses; while LAddresses.hasMoreElements do begin LAddress := TJInetAddress.Wrap(LAddresses.nextElement); if LAddress.isLoopbackAddress then Continue; // Hack until I can find out how to check properly LName := JStringToString(LAddress.getClass.getName); LHostAddress := JStringToString(LAddress.getHostAddress); // Trim excess stuff if LHostAddress.IndexOf('%') > -1 then LHostAddress := LHostAddress.Substring(0, LHostAddress.IndexOf('%')); if LName.Contains('Inet4Address') then TIdStackLocalAddressIPv4.Create(AAddresses, LHostAddress, '') else if LName.Contains('Inet6Address') then TIdStackLocalAddressIPv6.Create(AAddresses, LHostAddress); end; end; end;
-
Async/Await with updating visual controls
Dave Nottage replied to omnibrain's topic in OmniThreadLibrary
I do not see why you would not be able to use it. Did you see whether your example worked? -
Delphi 11.1, Android API 31, FLAG_IMMUTABLE in Pending Intent
Dave Nottage replied to nufus42's topic in FMX
Indeed. According to the docs, setting a scheduled notification in this demo: https://github.com/Embarcadero/RADStudio11Demos/tree/main/Object Pascal/Mobile Snippets/Notifications/SendCancelNotification Should fail, but it doesn't. At this point I have no idea why - the target SDK level is 32, and a PendingIntent is being created without the MUTABLE or IMMUTABLE flags being included. Back to the drawing board: You'll need to provide a reproducible example. -
Delphi 11.1, Android API 31, FLAG_IMMUTABLE in Pending Intent
Dave Nottage replied to nufus42's topic in FMX
Unfortunately, no.. and I don't know why it was missed. There's a couple of spots in System.Android.Notification.pas (local notification support) where a PendingIntent is used and the flag is not being included. Best you could do right now is to copy the unit, put it somewhere in your project path and make the necessary modifications. -
Delete the SDK from SDK Manager in Delphi Delete the MacOSX13 SDK folder from C:\Users\(username)\Documents\Embarcadero\Studio\SDKs Delete the cache-dir folders from the scratch-dir folder on the Mac Re-import the SDK
-
Both are in the list of fixes: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/New_features_and_customer_reported_issues_fixed_in_RAD_Studio_11.3
-
It appears there is not a single function "out of the box", but it wouldn't be too difficult to implement. TPath.GetHomePath is supposed to return /Users/<username> on macOS: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Standard_RTL_Path_Functions_across_the_Supported_Target_Platforms So appending "Desktop" should be reliable. For Windows you'd need to do a bit more work. TPath.GetDocumentsPath on Windows gives, for example: C:\Users\<username>\Documents, so you could remove the Documents part and add Desktop 🙂
-
I've now released Codex 1.6, which has the functionality I mentioned, and I had a crack at implementing Firebase Crashlytics, but I was unable to make it work. I guess I'm missing something; I just don't know what 🙂 There's a test project in the Playground repo: https://github.com/DelphiWorlds/Playground/tree/main/Demos/Crashlytics if anyone is interested in the work in progress
-
There's info about it here: https://firebase.google.com/docs/crashlytics/ndk-reports. There is also: https://firebase.google.com/docs/crashlytics/get-started?platform=android#java however since Delphi apps are native, I expect the former is more relevant, and it includes the SDK version as well anyway. A quick glance tells me that it should be able to be integrated into a Delphi app, however it appears it may need the same treatment as described in: https://quality.embarcadero.com/browse/RSP-20000 Next week I plan to release version 1.6 of Codex - the changes include functionality that is intended to help with this process.
-
Error while building an Android application in Delphi 10.4 Sydney
Dave Nottage replied to at3s's topic in FMX
Weird.. I could have sworn when I checked earlier there had not been any commits for that file since my first reply. Thanks! -
Error while building an Android application in Delphi 10.4 Sydney
Dave Nottage replied to at3s's topic in FMX
As per the earlier replies, in Grijjy.ErrorReporting.pas. Please read the replies to see exactly where in that unit, and what to change. -
Application crashed when i connect Android Service
Dave Nottage replied to Delpher2600's topic in FMX
Are you saying you do not understand this part? -
Application crashed when i connect Android Service
Dave Nottage replied to Delpher2600's topic in FMX
That doesn't show where in the project the code is executed. In later versions of Android, you a service needs to be started when the application is in the foreground, so you may need to execute the code that starts it in the OnShow event of the main form, or possibly add a listener for the BecameActive application event, and execute it then. Also, this code: Does not match the exception in the image, since 'Z' <> 'F'. I assume a typo, or you renamed the service. -
This code is not going to work. I suggest looking at the code for TLocalServiceConnection.TJavaServiceConnection.onServiceConnected in the System.Android.Service unit in the Delphi source code. Warning: it's not for the faint of heart 🙂
-
Might help to show your code for whatever implements JServiceConnection.