FetchSms
function FetchSms(sender:string):string; var cursor: JCursor; uri: Jnet_Uri; address, msgdatesent, body: string; addressidx, msgdatesentidx, bodyidx: integer; fMessage: string; begin uri := StrToJURI('content://sms/inbox'); cursor := TAndroidHelper.Activity.getContentResolver.query(uri, nil, nil,nil,nil); addressidx := cursor.getColumnIndex(StringToJstring('address')); msgdatesentidx := cursor.getColumnIndex(StringToJstring('date_sent')); bodyidx := cursor.getColumnIndex(StringToJstring('body')); cursor.moveToFirst; while (cursor.moveToNext) do begin address := JStringToString(cursor.getString(addressidx)); msgdatesent := JStringToString(cursor.getString(msgdatesentidx)); body := JStringToString(cursor.getString(bodyidx)); if UpperCase(address) = UpperCase(sender) then begin fMessage := msgdatesent+'-'+address+'-'+body; Break end; end; Result := fMessage; end;