firemonkey

How to have both VCL and FMX in one application?

99封情书 提交于 2019-12-13 15:04:49
问题 I have a VCL application and pretty isolated VCL code. I would like to include Fire Monkey forms for Mac OSX support. I plan using heavily IFDEF to determine should I build for Windows with VCL or for Mac OSX with FireMonkey. Unfortunately there is no way to add MacOS platform from the Project Manager if the application is VCL one. Is there a way to hack this somehow? Maybe manually tweak the .dpr and .dproj files? 回答1: What about doing it the other way around: start with a FireMonkey

Is PNG decoding not thread safe under android?

久未见 提交于 2019-12-13 10:53:36
问题 Using Delphi 10.2.3: I am writing code that repeat-decodes the same set of PNG images in multiple threads over and over again. Once the thread is executed, it uses an FMX TBitmap component's "LoadFromStream" method to decode a PNG file loaded into a TMemoryStream (within the thread). Running under Windows, no issues. Running under Android I get multiple exceptions and it appears to trigger randomly on just some of the threads: 1. Exception "Can not activate current context" 2. EReadError

Why when we add an android service to an app, delphi automatically include in the dpr of the app the unit of the datamodule of the service?

怎甘沉沦 提交于 2019-12-13 09:48:28
问题 When i create a new service, then this service will have a main datamodule (DM), and when i add this service to an already existing app, then delphi automatically add to the dpr (in the uses clauses) of this app the unit of the datamodule: uses ... ... myService_mainunit; why ? it's also make after not possible to compile under IOS ... 回答1: The IDE has absolutely no idea what your intentions are. It has no clue that you only want to use this for Android, regardless of if it's Android-specific

Drag Drop ListBoxItems from ListBox1 to ListBox2 with their images and avoiding duplication Delphi

烈酒焚心 提交于 2019-12-13 09:13:24
问题 My code is working and the drag and drop but what i want to add is to Drag and Drop items from ListBox1 to ListBox2 with their images. Also when i want to rearrange the items in ListBox2 it duplicates without deleting the previous one. Or if it's possible I would love to know how to move items from ListBox1 to ListBox2 with just a double Click no need to the drag and drop. I am using the 10.2 version Here is my code and i would appreciate if anyone can help me : type TListBoxItem = class(FMX

Is there an alternative to TMediaPlayer for multi platform rapid sound effects?

一笑奈何 提交于 2019-12-13 09:09:41
问题 I am looking for a way to play multiple rapid sound effects (WAV format) in a multi-platform game (Android and Windows) with low overhead. I tried using the TMediaPlayer component, but creating multiple instances adds a lot of overhead to startup and shutdown times. I researched and found this code which offers a low-overhead approach. Sadly, the code is incompatible with Delphi 10.2 (Tokyo) under Android (windows works fine). Under Android, the onLoadComplete is never triggered, causing the

How to use App Tethering with internet connection?

故事扮演 提交于 2019-12-13 07:24:26
问题 I'm using Embarcadero RAD Studio Delphi XE8. Multi-Device Application app tethering components are designed for traditional WiFi and Bluetooth coupling. Does it support also Internet connections? I would like to try to make small p2p app. I'm using App tethering via Wifi but I would like to connect App tethering via internet connection. how to do that ? 回答1: Yes, TCP/IP (LAN and Internet) is also supported. This is clearly explained in the documentation. Using App Tethering The app tethering

How to set a custom TAlphaColor programmatically?

家住魔仙堡 提交于 2019-12-13 07:09:54
问题 That's basically how I attribute colors programatically in Delphi label.FontColor := TAlphaColors.Yellow; What if I want a custom color like #FF1C90EF ? How can I set it programatically ? 回答1: It looks like you can pass the color to a new instance of TAlphaColor Eg, TAlphaColor($FF1C90EF) . Having said that, you can also just set the .FontColor property directly without creating a new instance of TAlphaColor . 回答2: Similar to TColor in VCL, TAlphaColor is just an integer (well, a Cardinal

Delphi 10.1 Berlin - Java2OP: class or interface expected

北城以北 提交于 2019-12-13 07:03:44
问题 I'm using Delphi 10.1 Berlin . I want to call Java codes from Delphi. So, I created JAR file in Android Studio (this link helped to me). Then I opened Java2OP.exe from C:\Program Files (x86)\Embarcadero\Studio\18.0\bin\converters\java2op directory. I moved the jar file to this directory. Then I worked this commands in CMD: SET PATH=%PATH%;"C:\Program Files\Java\jdk1.8.0_60\bin" Java2OP.exe -jar ..\libmylib.jar -unit ..\Androidapi.JNI.MyLib But I get this error: Warning: error opening

TListBox Items AddObject Firemonkey 10.2 [duplicate]

China☆狼群 提交于 2019-12-13 04:54:40
问题 This question already has an answer here : Delphi FireMonkey TListBox AddObject exception on Android (1 answer) Closed 10 months ago . I'm try on formShow add ListBox1.Items.AddObject('TEST 1', TObject(1)) ; ListBox1.Items.AddObject('TEST 2', TObject(2)) ; but app automatically close (crash). This example work fine ListBox1.Items.Add('TEST 1'); ListBox1.Items.Add('TEST 2'); Any solution how use Items.AddObject? 回答1: For FMX TListBox I suggest you use the Tag property instead. aItem:

Delphi Android download remote PNG to TImage

房东的猫 提交于 2019-12-13 04:35:55
问题 Trying to assign remote PNG file to TImage. I've tried following, it says "Invalid stream format". I have no clue how to download PNG image into Firemonkey styled apps (XE8): procedure TfrmMain.Button1Click(Sender: TObject); var qrString: String; MS : TMemoryStream; Png: TImageMultiResBitmap; begin MS := TMemoryStream.Create; Png := TImageMultiResBitmap.Create(Png); try IdHTTP1.get('https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=chujisko',MS); Ms.Seek(0,soFromBeginning); Png