pcplayer99
Members-
Content Count
93 -
Joined
-
Last visited
Community Reputation
11 GoodRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
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.
-
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.
-
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.
-
Getting FireMonkey iOS development off the ground
pcplayer99 replied to eivindbakkestuen's topic in Cross-platform
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. -
Howto handle Android BluetoothLE permissions that are compatible to API29,30,31 ?
pcplayer99 replied to Rollo62's topic in Cross-platform
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; -
what is the structure of the file needed for LoadLangFromFile ??
pcplayer99 replied to Al T's topic in Algorithms, Data Structures and Class Design
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. -
myabe you should check the AndroidManifest.template.xml of your project. and check: <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
-
Is it true that using FMX units will cause android apps to fail?
pcplayer99 replied to KMarb's topic in FMX
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. -
Strange behavior with "is" operator
pcplayer99 replied to Sonjli's topic in Algorithms, Data Structures and Class Design
if Attribute Is MyAttributeOne then vs if (Attribute Is MyAttributeOne) then -
Delphi 10.4.2 with XCode13 SDK15.0 packaging ipa fail
pcplayer99 replied to Raymond Ng's topic in Cross-platform
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. -
Delphi 10.4.2 with XCode13 SDK15.0 packaging ipa fail
pcplayer99 replied to Raymond Ng's topic in Cross-platform
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. -
please check this: WWDR Intermediate Certificate Expiration - Support - Apple Developer
-
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.
-
FireDAC, SQLite, iOS, what thing I have missed?
pcplayer99 replied to pcplayer99's topic in Cross-platform
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\" -
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.