Jump to content

Dave Nottage

Members
  • Content Count

    1560
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by Dave Nottage

  1. Dave Nottage

    [iOS] XCode 11 iPhone iOS13.2 preparing debug image

    Pretty sure Delphi can at least deploy to iOS 13.2 devices using Xcode 11.2 beta. I know for sure that Delphi 10.3.2 cannot debug for iOS 13.2 devices, though.
  2. There's no "easy" way to cater for older versions, whether it's iOS, macOS or Android. The best you can do is check the API documentation for which version the methods were introduced (or removed) and use TOSVersion.Check to determine whether the code is relevant and can be called, and branch to another part of the code if you need to cater for lower versions. There's a bunch of examples of TOSVersion.Check being used in the FMX code, so you could refer to them.
  3. Dave Nottage

    Mac address on Android 6.0 or above

    1. This should at least have you started: uses Androidapi.JNI.Java.Net, Androidapi.JNI.JavaTypes, Androidapi.Helpers, Androidapi.JNIBridge; function BytesToHex(const ABytes: TBytes): string; var I: Integer; begin Result := ''; for I := Low(ABytes) to High(ABytes) do Result := Result + IntToHex(ABytes[I], 2); end; procedure GetMacAddresses(const AAddresses: TStrings); var LInterfaces, LAddresses: JEnumeration; LInterface: JNetworkInterface; LJavaBytes: TJavaArray<Byte>; LBytes: TBytes; LByte: Byte; I: Integer; LAddress: JInetAddress; LName, LHostAddress: string; begin AAddresses.Clear; LInterfaces := TJNetworkInterface.JavaClass.getNetworkInterfaces; while LInterfaces.hasMoreElements do begin LInterface := TJNetworkInterface.Wrap(JObjectToID(LInterfaces.nextElement)); LJavaBytes := LInterface.getHardwareAddress; if LJavaBytes <> nil then begin SetLength(LBytes, LJavaBytes.Length); for I := 0 to LJavaBytes.Length - 1 do LBytes[I] := LJavaBytes.Items[I]; AAddresses.Add(BytesToHex(LBytes)); end; end; end; 2. Check the code (and warning) for GetUniqueDeviceID, here: https://github.com/DelphiWorlds/KastriFree/blob/master/Core/DW.OSDevice.Android.pas Apparently things have changed a little since Android 8: https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID
  4. If you're using Bluetooth for tethering, it's more than likely due to needing to request permissions for location at runtime, as Bluetooth discovery requires one of them: https://developer.android.com/guide/topics/connectivity/bluetooth#Permissions There's an example of how to do this in this demo: https://github.com/Embarcadero/RADStudio10.3Demos/tree/master/Object Pascal/Multi-Device Samples/Device Sensors and Services/Bluetooth/BLEScanner
  5. Dave Nottage

    Android, how to call a TJIntent

    Check the file AndroidManifest.xml in the folder: C:\Users\(username)\AppData\Roaming\Embarcadero\BDS\20.0 Where (username) is your logged in Windows username. This is the file that the IDE uses for AndroidManifest.template.xml. Part of the file should look like this: <%provider%> <%application-meta-data%> <%uses-libraries%> <%services%>
  6. It's a Delphi problem: https://quality.embarcadero.com/browse/RSP-26388
  7. Known issue. If you imported an iOS 12.x SDK from an earlier version of Xcode, target that for now.
  8. Dave Nottage

    Delphi Rio 10.3.2 : iOS Display Name

    Following exactly the same steps, from scratch?
  9. Dave Nottage

    Delphi Rio 10.3.2 : iOS Display Name

    Changed to: Bob Is A Developer Works OK. If it helps, my setup is: Delphi 10.3.2 iOS 12.4 SDK iPhone X running iOS 13.2 Xcode 11.1
  10. Dave Nottage

    Delphi Rio 10.3.2 : iOS Display Name

    Changing CFBundleDisplayName works OK for me. Here's my steps: 1. Create a blank FMX project 2. Save it as: Fred 3. Compile/Deploy to iOS device - it appears as "Fred" 4. Change CFBundleDisplayName from $(ModuleName) to: Bob 5. Compile/Deploy to iOS device - name changes to "Bob"
  11. Dave Nottage

    WebBrowser File Upload

    Looks like you'll need to file an enhancement request, at: http://quality.embarcadero.com The later answers at this link: https://stackoverflow.com/questions/5907369/file-upload-in-webview Have suggestions as to how it should be implemented; the important part being that the WebView descendant needs to implement openFileChooser.
  12. Dave Nottage

    Any update on the v10.3.3 release?

    Please email Calvin Tang at Embarcadero. His email address is the usual pattern, i.e. firstname.lastname@embarcadero.com
  13. Dave Nottage

    WebBrowser File Upload

    A reproducible test case might help.
  14. I wouldn't rely too much on a repo that infringes Delphi source copyright
  15. Dave Nottage

    Unit testing cross platform code

    Not entirely obvious from the FAQ etc: does TestInsight have some method of running tests on the device (or Mac machine) that are reported back to TestInsight in the IDE? Sorry if that's a stupid question 🙂 It may also be what Darian is interested in.
  16. Dave Nottage

    Unit testing cross platform code

    What might those adjustments or extensions be?
  17. Dave Nottage

    Access violation after notarization

    As far as I'm aware, yes, however it seems Apple has relaxed the requirement until January: https://www.macrumors.com/2019/09/03/apple-macos-catalina-notarization-mac-apps/
  18. Dave Nottage

    Access violation after notarization

    Without a reproducible test case, it would be hard to tell. Some prudent adding of Log.d calls and use of the Console app (in /Applications/Utilities) might help find where it is crashing.
  19. Dave Nottage

    Delphi 10.3.2 with Xcode 11 and iOS 13?

    Incorrect: https://help.apple.com/itc/apploader/#/apdATD1E53-D1E1A1303-D1E53A1126
  20. Dave Nottage

    Android - Segmentation fault (11) when closing app

    Without seeing all the code, it'd be hard to determine what is causing the issue.
  21. On Android, TPath.GetDocumentsPath is, and has always been, the sandboxed (i.e. app specific) documents folder. If you wish to access the shared documents folder, it is TPath.GetSharedDocumentsPath. Prior to Delphi 10.3, the targetSdkVersion being used in the manifest was 19. In Delphi 10.3 the targetSdkVersion is now 28. From API level 21, applications that need permission for external storage (which is what TPath.GetSharedDocumentsPath points to), need to request permission at runtime. For an example of how to do this, take a look at this demo: https://github.com/Embarcadero/RADStudio10.3Demos/tree/master/Object Pascal/Mobile Snippets/ShareSheet Specifically in the TShareSheetForm.btnTakePhotoClick method in uMain.pas where permissions for external storage are requested. You don't need to request permission for TPath.GetDocumentsPath, so I have no idea why that folder is not working for you. Are you attempting to access files that are being deployed there (i.e. they have entries in Deployment Manager)?
  22. Dave Nottage

    Delphi RIO Android not FindComponent

    You're naming the labels as (for example): 'LabelTwo'+TButton(Sender).Name but you're calling FindComponent as: FindComponent('LabelTwo'+TButton(Sender).Tag.ToString) When it should be: FindComponent('LabelTwo'+TButton(Sender).Name)
  23. Dave Nottage

    Android - Segmentation fault (11) when closing app

    I'd be more interested in how these are being created and free'd.
  24. Dave Nottage

    Android - Find other app pid number and kill it

    As long as it's just the background processes of the application you're interested in, you could use: https://developer.android.com/reference/android/app/ActivityManager#killBackgroundProcesses(java.lang.String) Since Android 2.2, you cannot close the entire application. You would probably do something like this (untested): uses Androidapi.JNI.JavaTypes, Androidapi.JNI.GraphicsContentViewText, Androidapi.JNI.App, Androidapi.Helpers; procedure Kill; var LService: JObject; begin LService := TAndroidHelper.Context.getSystemService(TJContext.JavaClass.ACTIVITY_SERVICE); if LService <> nil then TJActivityManager.Wrap(JObjectToID(LService)).killBackgroundProcesses(StringToJString('com.whateverpackagename.itis')); end;
  25. Dave Nottage

    The IDE Platform|Target items

    What did you change the locations to?
×