Goals: Integrate Firebase push notifications (FCM) into an app built with Delphi for iOS without the help of third-party libraries. Having the same base code in the application and in the servers for managing pushes in Delphi the same as that used for Android. Test environment used: VM Delphi 11 Alexandria Ent. Edition on…
Read more
Xtumble library for Delphi Xtumble4Delphi is native delphi library, cross platform ( Windows, Android, iOS, macOSX, Linux64) that allow you to integrate all cloud functonalitty of the XTumble platform in your application. If you create an XTumble Account you can have a dedicated ERP, e-commerce, Cluod Drive, CRM Mail with SMTP and POS system in the cluod. Creating an…
Read more
To check with Delphi / Firemonkey if the screen is in Landscape or Portrait mode i use the FMXPlatform library as in the example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
uses FMXPlatform; ... procedure TForm2.FormResize(Sender: TObject); var ScreenService: IFMXScreenService; begin if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, IInterface(ScreenService)) then begin if ScreenService.GetScreenOrientation in [TScreenOrientation.soPortrait, TScreenOrientation.soInvertedPortrait] then ShowMessage('Portrait Orientation') else Begin ShowMessage('Landscape Orientation'); End; end; end; |
Here is a sample code (function) to get the current language (locale) in Delphi 10Seattle. This simple procedure return the locale language for Windows, Mac and Android.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
function GetOSLangID: String; {$IFDEF MACOS} var Languages: NSArray; begin Languages := TNSLocale.OCClass.preferredLanguages; Result := TNSString.Wrap(Languages.objectAtIndex(0)).UTF8String; {$ENDIF} {$IFDEF ANDROID} var LocServ: IFMXLocaleService; begin if TPlatformServices.Current.SupportsPlatformService(IFMXLocaleService, IInterface(LocServ)) then Result := LocServ.GetCurrentLangID; {$ENDIF} {$IFDEF MSWINDOWS} var buffer: MarshaledString; UserLCID: LCID; BufLen: Integer; begin // defaults UserLCID := GetUserDefaultLCID; BufLen := GetLocaleInfo(UserLCID, LOCALE_SISO639LANGNAME, nil, 0); buffer := StrAlloc(BufLen); if GetLocaleInfo(UserLCID, LOCALE_SISO639LANGNAME, buffer, BufLen) <> 0 then Result := buffer else Result := 'en'; StrDispose(buffer); {$ENDIF} end; { code } //See more at: http://codeverge.com/embarcadero.delphi.firemonkey/detect-current-language-on-andr/2001235#sthash.zjLIi2KY.dpuf |