Function TForm1.GetCalEvents(DTNow: TDateTime): Boolean;
var
Cursor: JCursor;
l_eventUri: Jnet_Uri;
SortOrder: JString;
Selection: JString;
SelectionArgs: TJavaObjectArray<JString>;
l_projection: TJavaObjectArray<JString>;
sSQLEventAbfrage:
String;
EventCount: integer;
EventId: integer;
begin
Result := False;
l_eventUri := StrToJURI('
content://com.android.calendar/events');
l_projection := TJavaObjectArray<JString>.Create(8);
l_projection.Items[0] := StringToJString(TokTitle);
l_projection.Items[1] := StringToJString(TokDTStart);
l_projection.Items[2] := StringToJString(TokDTEnd);
l_projection.Items[3] := StringToJString(TokEventTimeZone);
l_projection.Items[4] := StringToJString(TokHasAlarm);
l_projection.Items[5] := StringToJString(TokOriginal_ID);
l_projection.Items[6] := StringToJString(TokAllDay);
l_projection.Items[7] := StringToJString(TokID);
SortOrder := StringToJString('
dtstart ASC, dtend ASC');
// vom ältesten zum neuesten Eintrag
Selection :=
nil;
Selection := StringToJString(sSQLEventAbfrage);
SelectionArgs :=
nil;
// im Moment nicht genutzt
// hier die Abfrage der Termine im jeweiligem Zeitraum
Cursor := TAndroidHelper.Activity.getContentResolver.query(l_eventUri,
l_projection, Selection, SelectionArgs, SortOrder);
if not Assigned(Cursor)
then
begin
// Log('GetCalEvents not Assigned(Cursor)', []);
Exit;
end;
EventCount := Cursor.getCount;
end;