This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original demo is at: | |
// https://github.com/Embarcadero/RADStudio11Demos/tree/main/Object%20Pascal/Mobile%20Snippets/Notifications/SendCancelNotification | |
// Code to add to the implementation section. Use code completion to add it to the interface section: | |
const | |
cNotificationChannelId = 'NotificationsDemo'; | |
constructor TNotificationsForm.Create(AOwner: TComponent); | |
begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
System.SysUtils, System.DateUtils, System.StrUtils; | |
// examples: | |
// Wed, 3 Nov 2021 18:20:21 +1030 | |
// 21 Dec 2021 19:04:06 GMT | |
function FeedDateToDateTime(const AFeedDate: string): TDateTime; | |
var | |
LParts: TArray<string>; | |
LISO8601, LDay, LMonth: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
Androidapi.JNI.JavaTypes, Androidapi.JNI.App, Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers; | |
var | |
LArrayList: JArrayList; | |
LIntent: JIntent; | |
LPendingIntent: JPendingIntent | |
begin | |
LIntent := TJIntent.Create; | |
// *** Here, call setAction and whatever else needs to be done to initialize LIntent *** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Unit1; | |
// With help from this SO post: | |
// https://stackoverflow.com/a/16678161/3164070 | |
// ******* NOTE ********* | |
// As per the comment in the Acivate method: | |
// This assumes you have actually created a socket that is listening on the selected port | |
interface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
Macapi.Foundation; | |
type | |
NSNetService = interface; | |
NSNetServiceBrowser = interface; | |
NSNetServiceDelegate = interface; | |
NSNetServiceBrowserDelegate = interface; | |
PNSInputStream = ^NSInputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TForm1 = class(TForm) | |
Map: TMapView; | |
private | |
FMarkerA: TMapMarker; | |
FMarkerB: TMapMarker; | |
procedure AddMarkers; | |
public | |
constructor Create(AOwner: TComponent); override; | |
end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
Androidapi.Helpers, Androidapi.JNI.Provider, Androidapi.JNI.GraphicsContentViewText; | |
procedure ShowManageExternalStorageSettings; | |
var | |
LIntent: JIntent; | |
begin | |
LIntent := TJIntent.Create; | |
LIntent.setAction(StringToJString('android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION'); | |
LIntent.setData(TJnet_Uri.JavaClass.parse(StringToJString('package:' + JStringtoString(TAndroidHelper.Context.getPackageName())))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
{$IF Defined(IOS)} | |
Macapi.ObjectiveC, | |
iOSapi.Foundation, | |
{$ELSE} | |
Macapi.Foundation, | |
{$ENDIF} | |
Macapi.Helpers; | |
{$IF Defined(IOS)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: this is just parts of the unit to show what to "patch". Please refer to the readme.md in this gist | |
unit FMX.Maps.iOS; | |
interface | |
{$SCOPEDENUMS ON} | |
procedure RegisterMapService; | |
implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
Androidapi.Helpers; | |
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); | |
begin | |
if key = vkHardwareBack then | |
begin | |
Key := 0; | |
TAndroidHelper.Activity.moveTaskToBack(True); | |
end; |