delphi-xe5

How do I handle a back-button press in a (Delphi) Android app?

牧云@^-^@ 提交于 2019-12-30 01:55:07
问题 How can I make my Android app react to the back-button? Is there something as high-level VCL's TApplicationEvents to handle it, or do I need to dive deep into low-level Android-specific stuff here? Right now, most of the demo applications have an on-screen back button to go back to a previous screen. Pressing the psysical button always seems to quit the app, and in some situations it results in an access violation. 回答1: In the form's OnKey... events, the Key parameter is vkHardwareBack on

How to close android app in Delphi-XE5 Firemonkey application?

夙愿已清 提交于 2019-12-28 04:26:14
问题 I have this piece of code procedure TFormMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean); var msg: String; begin msg := 'Do you really want to exit?'; if MessageDlg(msg, TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0) = mrNo then CanClose := False else CanClose := True; { FIXME: don't want to work on Android } end; It works perfectly on Windows. Application closes if I choose 'Yes'. However, application does NOT close on Android. What I am doing wrong? 回答1:

Delphi XE5 - Threads and memory leak when operation on TBitmap

。_饼干妹妹 提交于 2019-12-24 16:37:03
问题 Application works as I'd like but there are quite big memory leakage. Every event that throttles one thread gives me 4 TBitmaps and 2 TStrokeBrush that are lost. The procedure DrawSine(); is triggered in Execute in Synchronize statement: procedure SineThread.DrawSine(); var sin_T : Extended; Point2 : TPoint; I : Integer; begin TempBitmap.SetSize(Twidth, Theight); TempBitmap.Canvas.BeginScene(); TempBitmap.Canvas.Stroke.Kind := TBrushKind.bkSolid; TempBitmap.Canvas.Stroke.Color := claLime;

How do I render text along an arc in an image?

吃可爱长大的小学妹 提交于 2019-12-24 13:05:14
问题 I have the following code in Delphi 7 to draw Copyright text along the curved edge of a DVD. We are using an old version of Graphics32. We are switching to Delphi XE5 with the latest code from Graphics32 and this code no longer compiles; in particular LoadArcCurve and drawingBuffer.RenderFittedText no longer exists as methods. procedure TCDLabel.DrawCopyrightText(const drawingBuffer: TBitmap32Ex); var FixedPointArray : TArrayOfFixedPoint; Center : TFixedPoint; vAngle1 : double; vAngle2 :

Update bindsource and listview

回眸只為那壹抹淺笑 提交于 2019-12-24 07:16:33
问题 I am working on a Delphi XE5 Firemonkey Mobil app. I use FireDac for connection. Just trying to do a simple query insert into sQlite database and update the listview with the inserted info. procedure TTabbedwithNavigationForm.Button4Click(Sender: TObject); begin DataModule1.qSelectCustomers.SQL.Text := 'insert into Invoice (Name) values(:newName)'; DataModule1.qSelectCustomers.ParamByName('newName').AsString := 'test'; DataModule1.qSelectCustomers.ExecSQL; BindSourceDB1.DataSet.Refresh; ///

Firemonkey Mobile Application and remote MySQL

大憨熊 提交于 2019-12-24 04:52:08
问题 I am using Delphi XE5 and I have created basic Firemonkey Mobile Application - Delphi I would like to connect to a remote MySQL database. Which if any database conduit do I use? (FireDAC, DBExpress, etc)? 回答1: You can use standard TSQLQueries, but as your mobile app needs to connect to a remote database, you will need to go via a DataSnap service (most probably hosted on an IIS server). The mobile device then connects to the DataSnap server which then connects to the database. The DataSnap

Create WifiConfiguration with Delphi XE5 for Android

亡梦爱人 提交于 2019-12-24 01:43:46
问题 I'm trying to create a WifiConfiguration for Android. All other properties can be set. But if i try to set the SSID or BSSID, i'm getting a segmentation fault (11) and the app and Delphi just hangs. var WIFIConfig: JWifiConfiguration; begin WIFIConfig := TJWifiConfiguration.JavaClass.init; WIFIConfig.hiddenSSID := false; -> works WIFIConfig.SSID := StringtoJString('"YOUR_WLAN_SSID"'); -> App just hangs end; http://developer.android.com/reference/android/net/wifi/WifiConfiguration.html

Delphi XE5 AndroidManifest. Can not set minSdkVersion=14 or bigger

纵然是瞬间 提交于 2019-12-24 01:28:03
问题 //Deilhi-XE5 Android Development I have a strange problem when I tried to set minSdkVersion in AndroidManifest.template.xml to 14 or latest version. When it is equal "9" or "10" my app works fine. But when I set minSdkVersion manually to "14" it is running but getting crash on screen orientation change. And the most funny thing that crash appears in module IdStack (indy) (no code to that module in resize event). But problem not in Indy for sure. Example: Open project "Forms" in Embarcadero

How to check iOS version delphi xe5/xe6

血红的双手。 提交于 2019-12-23 20:39:35
问题 Is there a way to check the iOS version within a Delphi app? I would like to create specific piece of code for iOS7 and iOS6 in Delphi XE6. 回答1: You can use TOSVersion record in System.SysUtils. if TOSVersion.Check(7, 0) then //Os is iOS 7 Also you can find sample for iOS here. 来源: https://stackoverflow.com/questions/26758808/how-to-check-ios-version-delphi-xe5-xe6

Why are two seemingly identical dynamic array types deemed not assignment compatible?

…衆ロ難τιáo~ 提交于 2019-12-23 09:43:07
问题 Just a little question, I'm not finding a specific answer so i guessed it might be faster to ask here. The compiler rejects the code below with the following error: incompatible types 'dynamic array' and 'array of string' TMailInfo = record FileName, MailAdresse, MailBCC, MailCC, MailBetreff: string; MailText, Anhang: array of string; MailAcknowledge, MailTXT: Boolean end; class function TEMail.SendOutlookCOMMail(aFileName, aMailAdresse, aMailBCC, aMailCC, aMailBetreff: string; aMailText,