Jump to content

pcplayer99

Members
  • Content Count

    93
  • Joined

  • Last visited

Everything posted by pcplayer99

  1. Just a test program, too simple: TForm1 = class(TForm) ToolBar1: TToolBar; SpeedButton1: TSpeedButton; MediaPlayer1: TMediaPlayer; MediaPlayerControl1: TMediaPlayerControl; Layout1: TLayout; ProgressBar1: TProgressBar; Timer1: TTimer; Layout2: TLayout; Label1: TLabel; procedure SpeedButton1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure FormShow(Sender: TObject); private { Private declarations } function GetMyFileName: string; procedure GetPermissions; public { Public declarations } end; There are some code copy from "RADStudio10.3Demos-master\Object Pascal\Mobile Snippets\VideoPlayback" : procedure TForm1.Timer1Timer(Sender: TObject); begin if ProgressBar1.Max <> MediaPlayer1.Duration then ProgressBar1.Max := MediaPlayer1.Duration; if ProgressBar1.Value <> MediaPlayer1.CurrentTime then ProgressBar1.Value := MediaPlayer1.CurrentTime; end; Compile IDE: Delphi 10.3.1 Community version. Test environment: A. Android 5.0; B. Android 9.0; Issues: 1. If there is no MediaPlayerControl1, under Android 5.0 it can play MP4 video file, can hear audio playing of this MP4 file, and ProgressBar1 working fine . But if there is a MediaPlayerControl1, after I call MediaPlayer1.Play, APP will raise a exception: Project testMediaPlayer.apk raised exception class EJNIException with message 'java.io.IOException: Prepare failed.: status=0x80000000'. 2. Under Android 9.0, it can play MP4 video, but ProgressBar1 can not work. Set up a break-point on "if ProgressBar1.Max <> MediaPlayer1.Duration then" every time the timer1 trigger, MediaPlayer1.Duration is -1.
  2. pcplayer99

    import matplotlib error

    Hello, I'm testing Python4Delphi . Everything is ok beforeI tested import matplotlib. My environments are: 1. Windows 11; 2. Anaconda, Python 3.11.5 3. Delphi 11 CE . 4. Delphi VCL project, target platform is Windows 64. Here is my test code: import matplotlib.pyplot as plt import sys print(sys.version_info) print(sys.path) squares = [1, 4, 9, 16, 25]; plt.plot(squares); plt.grid(True) print('Start') plt.show(); print('End') I have ran this script in PyScripter, it's OK. In Delphi,I have created a VCL project, and run the python script in it by using: PythonEngine1.ExecStrings(Memo2.Lines); It raise exception: Project testDrawLine.exe raised exception class $C000008E with message 'c000008e FLOAT_DIVIDE_BY_ZERO'. I commented out "import matplotlib.pyplot as plt" and the error disappears. I commented out all code but just print code and import matplotlib.pyplot, it raises the same exception. So I am sure the error is caused by "import matplotlib.pyplot". I have tested add: from io import BytesIO from PIL import Image There is no exception, it works fine. I have checked the Python version in Delphi project and PyScripter by: import sys print(sys.version_info) And I got the same version info: procedure TForm2.Button1Click(Sender: TObject); var OldControlWord: Word; begin OldControlWord := Get8087CW(); Set8087CW($133F); try PythonEngine1.ExecStrings(Memo2.Lines); finally Set8087CW(OldControlWord); end; end; sys.version_info(major=3, minor=11, micro=5, releaselevel='final', serial=0) So, the same python environment, the same python code, works fine in Pyscripter and got exception in Delphi VCL project. I searched online and found this: https://stackoverflow.com/questions/3933851/nan-giving-an-error-depending-on-python-startup So, I test this code below, but it raises the same exception: procedure TForm2.Button1Click(Sender: TObject); var OldControlWord: Word; begin OldControlWord := Get8087CW(); Set8087CW($133F); try PythonEngine1.ExecStrings(Memo2.Lines); finally Set8087CW(OldControlWord); end; end; Did I miss something that cause this exception? Thanks.
  3. pcplayer99

    import matplotlib error

    Problem solved. https://github.com/pyscripter/python4delphi/wiki/MaskFPUExceptions procedure TForm3.PythonEngine1BeforeLoad(Sender: TObject); begin MaskFPUExceptions(True); PythonEngine1.SetPythonHome('D:\Python_Anaconda\'); end; Add MaskFPUExceptions(True); here and it works ok.
  4. Delphi 10.4.2 CE; Windows sybsystem for Android; ADB connect 127.0.0.1:58526; And then... New a FMX porject, select target platform as Android 64, named it as: "test" In Delphi IDE, I can see a Android device named: Subsystem for Android(TM); Selected it, and the F9 run it, after build and package, finally I got a error message: "Your Android device does not support the selected target platform architecture.". To check the project's folder, there is a test.apk file. I use ADB install test.apk and it successed. Then I can find my test program in Windows's startup menu, and can get it run well. How to get Delphi IDE install and debug with WSA ? if I select target platform as Android 32, and use ADB install, it can install sucessed, but if I run it, it just show the default splash image.
  5. pcplayer99

    Getting FireMonkey iOS development off the ground

    My experience: Check this or other the same type: Apple Worldwide Developer Relations Intermediate Certificate Maybe it is valid in your computer but if you delete it and re-install it by download a newer version from APPLE, maybe you can go through it.
  6. To get permission to access BLE, you must add some code to your program. Please check: ...Samples\Object Pascal\Multi-Device Samples\Device Sensors and Services\Bluetooth\BLEScanner procedure TForm6.btnStartScanClick(Sender: TObject); begin PermissionsService.RequestPermissions([FLocationPermission], RequestPermissionsResult, DisplayRationale); end;
  7. Hi, Please read: http://docwiki.embarcadero.com/Libraries/Berlin/en/FMX.Types.TLang It says: There are special cases where switching between languages does not work as expected if the language that you switch to is English (en). As a workaround, we recommend that you use LoadLangFromStrings instead of setting TLang.Lang to switch between languages at run time. So, you can save your language file as a text file, it's contain is key=value format. One language, one file. If you want changes the language, load another file.
  8. pcplayer99

    Android API31 Rad 11.1

    myabe you should check the AndroidManifest.template.xml of your project. and check: <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
  9. as the post of Stackoverflow said, he use android's log.d in FireMonkey app. As Dave Nottage said: You cannot use FMX.xxx units in an Android service built with Delphi. So, the problem is not Delphi FMX can not create stable Android APP. yes, can create stable Android App by using Delphi FMX.
  10. if Attribute Is MyAttributeOne then vs if (Attribute Is MyAttributeOne) then
  11. pcplayer99

    QUIC and HTTP/3

    Hi, Google will support HTTP/3 on QUIC in Chrome brwoser. Is there any Delphi library that support QUIC? Thanks.
  12. I have installed Delphi 10.4.2 CE version. All configurations is default by delphi installer. My phone is OPPO and its Android version is Android 11. New a FireMonkey project, connected my phone to my PC, and run it, everythiing is OK. But if I upload this APP to Google play APP store, it says APP's API level is 29, it must be API level 30. I run "C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\SDK Manager.exe“, it is installed by Delphi. And there are Android 10 (API 29), Android 9(API 28) ... etc. There are no API 30. So, I run "C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\tools\bin\sdkmanager.bat" to download API 30 and its done. And then re-start "SDK Manager.exe", I can see "Android 11(API 30)" in it. And in this directroy "C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms", there was added a directory named "android-30". So it seems I have API 30 in my system. In Delphi IDE menu: Tools - Options - Deployment - SDK Manager, SDK API-level location option is set by Delphi, it is "C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms\android-29", I changed it to "C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms\android-30"; And then re-deploy this APP and upload to Google play, it still says my APP is on API 29. I can not find any tips in IDE menu to change API level, so I check "AndroidManifest.xml" under "D:\MyProjectFile\Android64\Release", there is: <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" /> I try to modify "D:\MyProjectFile\AndroidManifest.template.xml" from default: <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" /> to: <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="30" /> to force it be API-30. And re-build, deploy, and then upload to Google play, it works. No warning messages. But, if I set project's "Configuration" to "Development" in IDE and press F9 to let it run in my phone, when it is installing in my phone, it is failed, and Delphi shows error message: adb: failed to install D:\MyProjectFile\Android64\Debug\testAndroid_11\bin\testAndroid_11.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES] And then I change "AndroidManifest.template.xml" to default, and re-build and deploy and press F9, it has installed in my phone success and worked fine. And then I check "AndroidManifest.xml", it is "<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" /> " again. Repeat modify "AndroidManifest.template.xml" again and again, I'm sure if I set targetSDKVersion=29, it can install in my phone successed, if I changed it to targetSDKVersion=30, it install in my phone will be failed and the error message is: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]. If I change targetSDKVersion=29 to targetSDKVersion=30, and then set my project Configuration to "Application Store" build and deploy then I got my AAB file and can upload Google play successed, but I am not sure if it can installing success when a phone install it from Google play. I have searched on internet, but no any message about this.
  13. pcplayer99

    Delphi 10.4.2 with XCode13 SDK15.0 packaging ipa fail

    it's wired. I have done "deploy" and got my "ipa" file on 2022-2-22; And then I install email tool "Thunderbird" in my MAC, and then install "Transporter" for upload my ipa. And then in "transporter" I add my ipa and click the "check" button, it popup an error message that the icon included Alpha channel. So, I update my icons, and then rebuild my app in Delphi, and then deploy it, and I got error message like "xcodebuild[863:7522] CFURLRequestSetHTTPCookieStorageAcceptPolicy_block_invoke: no longer implemented and should not be called". I try to do deploy again and again, restart my MAC, restart my Delphi, it is aways show me the same error message, I search on Internet and I find this thread. Today, I have do nothing with my Delphi and my Mac, and I try again, It did deploy successfully, I got a new ipa file, and I upload this new ipa file with using Transporter successfully. So, it's wired. I don't know why.
  14. pcplayer99

    Delphi 10.4.2 with XCode13 SDK15.0 packaging ipa fail

    Hello, I got the same error. I'm using BigSur and xCode 13, Delphi 10.4.2 CE version. I have deployed successfully on 22/2/2022. I got an ipa file. and then, I install "Transporter" APP in MAC, and when I click "deploy" menu in Delphi, I got the same error messages.
  15. pcplayer99

    iOS app can’t start on iPhone

    please check this: WWDR Intermediate Certificate Expiration - Support - Apple Developer
  16. pcplayer99

    iOS app can’t start on iPhone

    Make sure your certificate is valid. And the certificate of "ios_development.cer" is the new version. In your mac system, this ios_development maybe not be expired, but just is a low version. You can download a new version on Apple's developer web page.
  17. Hello, I'm testing if I can debug in iOS, this is my first experience of iOS. Delphi 10.4.2, FireMonkey, FireDAC, SQLite, iOS 15.2 Just a test, my code like: FDConnection1.Close; S := TPath.Combine(TPath.GetDocumentsPath, 'My.db'); //for Android FDConnection1.Params.Database := S; FDConnection1.Open; FdQuery1.Open; FdQuery2.Open; FdQuery1.SQL.Text := 'select * from MyTable'; in Delphi IDE deployment window, this 'My.db' is in "Remote Path" -- ".\assets\internal\" -- in Android and iOS, there is the same content. if the target is Windows or Android, it can work fine. if the target is iPhone, when it runs step to FdQuery1.Open, Delphi raise an exception message: Project Project1 raised exception class ESQLiteNativeException with message '[FireDAC][Phys][SQLite] ERROR: no such table: MyTable'. The PAServer in MAC shows these messages: error: Project1 :: Class 'TFDDatSManger' has a base class 'Firedac::Dats::TFDDatSNamedObject which does not have a complete definition. So, there must be some things I have missed ? Thanks.
  18. pcplayer99

    FireDAC, SQLite, iOS, what thing I have missed?

    Found reason. This error message is caused by my sqlite db file: "My.db" has not installed into iPhone. It's my fault. The reason is that in Delphi IDE deployment windows, add a file, at the "Remote Path", mouse click and drop down, only one item: ".\assets\internal". So I select this item. I know this item is ok when release Android App. In iOS, it must be: ".\StartUp\Documents\"
  19. pcplayer99

    Sample needed for Net.TSocket UDP cliente and server

    In Indy's document, it is said that you can not do any time consuming method in TIdUDPServer.OnRead procedure. to avoid TIdUDPServer loss package, I have added a buffer to receive data from TIdUDPServer.OnRead event. and then create another thread to handle data in this buffer.
  20. I have just released a simple Android APP compiled by Delphi 10.4.2. CE version. Here is the link: https://play.google.com/store/apps/details?id=com.embarcadero.BTthermometer I'm studying how to release to Apple store. Is it possible to install Mac OS and Xcode in VirtualBox to deploy APP to iOS?
  21. pcplayer99

    Delphi 10.4.2 CE support Android API 30

    Hi Dmitry, My new progress: Yesterday I have tested Android API-level 30 at a new blank FMX project, it's OK. And then I have tested a old project at release mode, it still report the same error message: INSTALL_PARSE_FAILED_NO_CERTIFICATES But if I selected debug mode, the same old project can install successed at API-level 30. I compared all XML files of release mode and debug mode but can not find anything. But if I change API-level 30 to 29 at release mode, it can installed successed. Finally, I created a new project and added all files of the old project into it, and then at Android release mode, changed API-level to 30, builded and deployed to my phone, it was successed. thanks Dmitry.
  22. pcplayer99

    SOAP Client Android

    In good old days, my manifest like this: <application android:persistent="%persistent%" android:restoreAnyVersion="%restoreAnyVersion%" android:label="%label%" android:debuggable="%debuggable%" android:largeHeap="%largeHeap%" android:icon="%icon%" android:theme="%theme%" android:hardwareAccelerated="%hardwareAccelerated%" android:resizeableActivity="false" android:usesCleartextTraffic="true"> And it can access web server through "HTTP" in Android. but Android 11, I don't know.
  23. pcplayer99

    Delphi 10.4.2 CE support Android API 30

    Thanks Dmitry. It works! A little update: <Exec Command=""$(ApkSigner)" sign --ks $(KeyStoreFile) --ks-pass pass:$(KeyStorePass) $(SIGNED_APK_FILENAME)" ContinueOnError="True"> when open project, it shows a error message, and then fail. I look through carefully the CodeGear.development.Targets file, found that: <Exec Command="&quot;$(BDS)\bin\convert.exe&quot; -b -e.fsx &quot;%(ConvertForm.BaseName)&quot;" ContinueOnError="True"> <Exec Command="&quot;$(BDS)\bin\convert.exe&quot; -b -e.fsx &quot;%(ConvertForm.BaseName)&quot;" ContinueOnError="True"> So, I update the above line to: <Exec Command="&quot;$(ApkSigner)&quot; sign --ks $(KeyStoreFile) --ks-pass pass:$(KeyStorePass) $(SIGNED_APK_FILENAME)" ContinueOnError="True"> And open project successed. And then I can install APK to my phone after I update android:targetSdkVersion="30" Thanks a lot.
  24. pcplayer99

    Delphi 10.4.2 CE support Android API 30

    Thanks Dmtry. I'll try.
  25. pcplayer99

    Delphi 10.4.2 CE support Android API 30

    Thanks Vave. According to your tips, I googled on line and got this: xamarin.android - Xamarin App - Can't deploy to Android 11 emulator - Stack Overflow Its says that: "Apps that target Android 11 (API level 30) that are currently only signed using APK Signature Scheme v1 must now also be signed using APK Signature Scheme v2 or higher. Users can't install or update apps that are only signed with APK Signature Scheme v1 on devices that run Android 11."
×