Jump to content

erva

Members
  • Content Count

    43
  • Joined

  • Last visited

Everything posted by erva

  1. Trying to set Android app so that it doesn't go to sleep mode. Added to uses Android.JNI.PowerManager but compiler doesn't find it. Does in Tools/Options/Language/Library paths need to add path to some folder where Android.JNI.PowerManager exists or what do i need to do?
  2. erva

    TStringGrid Sorting

    Simple question: How to sort values in TStringGrid based on one columns values? Searched with google and find only articles that are 6-8 years old. Is TStringGrid evolved from those days or are info in these still relevant? I mean is there any easier solution for sorting than these old articles?
  3. I can't install macOS 64-bit at SDK Manager. When try to install, it doesn't get saved to to "SDK versions" lists. macOS 32-bit i can uninstall and reinstall with no problems, problems are only with 64-bit.
  4. erva

    Can't install macOS 64-bit

    Reinstalled Delphi, but problem still exist. Managed to install iOS SDK without problems to free install.
  5. I was able to compile to macOS fine, but after installing TMS Software components i get this error, any idea what to do? [dccosx64 Error] E2597 ld: file not found: librtlhelper.a
  6. Noticed that in Platform Properties SDK was empty. When try to add new SDK, "Add a New SDK" settings are just like in previous post, it doesn't get saved. SDK stays empty.
  7. Thanks for help again, they were messed. I think it has something to do with that i installed one 3rd party component demo and from demo was support for macOS eluded. I didn't now it first and tested manually add library paths to components. Now i have added all missing items but when compiling error rises without any explation: And during compilation this windows appears:
  8. erva

    TStringGrig formatting date

    Trying to format date to show dd.mm.yyyy but don't get how it's complished. Have tried it with columns "customFormat" property but with no success.
  9. erva

    TStringGrig formatting date

    Mysterious things happening.... I got date formatting working ok. But then made changes to DB structure and after that grids first and last dates show like they should, others not
  10. erva

    TStringGrig formatting date

    That 'displaytext' property i was missing from grid side, thanks a lot:)
  11. erva

    TStringGrig formatting date

    Tried FormatDateTime('dd.mm.yyyy', Now); but get this exception:
  12. erva

    TStringGrig formatting date

    I'am using FormatDateTime('dd.mm.yyyy', %s) and get error "Invalid class typecast".
  13. erva

    TStringGrid Sorting

    Haven't used Delphi for a while, 15 years, and have managed to forget things little. But just remember based on @Attila Kovacsanwer that IndexDefFields is answer. Already managed to sort records ascending order, now have to still find out how to get them descending order. Using RemObjects Data Abstract. Adding to IndexDefField "Column1:D" didn't work.
  14. Is it possible to delete calls with code from Android call log. In permission is option to allow writing to call log, so probably it's possible to delete calls also? I manage to read calls from log and append them to DB. But user have to manually delete calls from phone so they don't get processed second time. Noticed also that if in log is more than 30 calls, my app crashes when reading calls.
  15. erva

    Receiving incoming calls

    Thinking if can't get number in Android 10 and beyond that, solution might be adding in DB with client record same name what's in phones address book. We need to track existing clients calls and how long they take, one person takes care about 50 clients so that might be working solution.
  16. erva

    Receiving incoming calls

    Can you get caller name from log? I have Android 9 and some day we have to move to Android 10. If phone number is not showing anymore, must think other solutions to link call to your customers in CRM.
  17. erva

    Receiving incoming calls

    Found this discussion, might be that in Android 10 getting call number is not possible anymore for security reasons? https://support.google.com/android/thread/38640488?hl=en
  18. erva

    Receiving incoming calls

    I have just a "demo" app what reads call log when started. Been thinking solutions when to transfer calls to database. Maybe this kind of solution to append to DB only new calls: 1. Read call from log 2. Search from DB if call with same unix time exists in DB. 3. If not found, append call to db Been thinking if it's possible remove calls from log with code?
  19. erva

    Receiving incoming calls

  20. erva

    Receiving incoming calls

    I abandod catching calls immediately when phone rings. Get calls info from call log, number and seconds what call last and move them database. Reading Android call logs seems to working flawless.
  21. Any idea where i can change Object Inspector text color "Lila"(?) to something else. Can't see it at this age 🙂
  22. erva

    Calculated field

    I'am evaluating RemObjects Data Abstract and trying to get calculated field to show values at grid components column but it stays empty. I have in table's OnCalcField event this code: procedure TClientDataModule.tbl_tasksCalcFields(DataTable: TDADataTable); begin if DataTable.FieldByName('done').AsInteger = 1 then begin DataTable.FieldByName('isDone').AsWideString := 'Open'; end else DataTable.FieldByName('isDone').AsWideString := 'Done'; end; Also set field calculated property to true. I tested code above if it's gets executed adding there ShowMessage('Test') and it gets executed. Haven't been using Delphi 15 years and don't member if there's something that i'am missing in properties etc.....
  23. I'am reading calls from Android call log. Date format is something that Delhi don't recognise. Date is returned like this: "1587377791601". Any idea what this number means and how to get date and time from it? Here's code what works, i have commented out lines what i don't want use. In commented lines is (StringToJString(...)) but it must be ( TJCallLog_Calls.JavaClass....) : var cursor: JCursor; uri: Jnet_Uri; CACHED_FORMATTED_NUMBER, CACHED_LOOKUP_URI, CACHED_MATCHED_NUMBER, CACHED_NAME, CACHED_NORMALIZED_NUMBER, CACHED_NUMBER_LABEL, CACHED_NUMBER_TYPE, CACHED_PHOTO_ID, CONTENT_ITEM_TYPE, CONTENT_TYPE, COUNTRY_ISO, DATA_USAGE, DATE, DEFAULT_SORT_ORDER, DURATION, EXTRA_CALL_TYPE_FILTER, FEATURES, IS_READ, LIMIT_PARAM_KEY, NEW, NUMBER, NUMBER_PRESENTATION, OFFSET_PARAM_KEY, PHONE_ACCOUNT_COMPONENT_NAME, PHONE_ACCOUNT_ID, TRANSCRIPTION, TYPEX, VOICEMAIL_URI : integer; msgunixtimestampms:int64; CACHED_FORMATTED_NUMBERx, CACHED_LOOKUP_URIx, CACHED_MATCHED_NUMBERx, CACHED_NAMEx, CACHED_NORMALIZED_NUMBERx, CACHED_NUMBER_LABELx, CACHED_NUMBER_TYPEx, CACHED_PHOTO_IDx, CONTENT_ITEM_TYPEx, CONTENT_TYPEx, COUNTRY_ISOx, DATA_USAGEx, DATEx, DEFAULT_SORT_ORDERx, DURATIONx, EXTRA_CALL_TYPE_FILTERx, FEATURESx, IS_READx, LIMIT_PARAM_KEYx, NEWx, NUMBERx, NUMBER_PRESENTATIONx, OFFSET_PARAM_KEYx, PHONE_ACCOUNT_COMPONENT_NAMEx, PHONE_ACCOUNT_IDx, TRANSCRIPTIONx, TYPEXx, VOICEMAIL_URIx : string; CallTime: TDateTime; Result: String; begin uri:=StrToJURI('content://call_log/calls'); cursor := SharedActivity.getContentResolver.query(uri, nil, nil,nil,nil); // CACHED_FORMATTED_NUMBER:=cursor.getColumnIndex(StringToJstring('CACHED_FORMATTED_NUMBER')); // CACHED_LOOKUP_URI:=cursor.getColumnIndex(StringToJstring('CACHED_LOOKUP_URI')); // CACHED_MATCHED_NUMBER:=cursor.getColumnIndex(StringToJstring('CACHED_MATCHED_NUMBER')); CACHED_NAME:=cursor.getColumnIndex( TJCallLog_Calls.JavaClass.CACHED_NAME ); // CACHED_NORMALIZED_NUMBER:=cursor.getColumnIndex(StringToJstring('CACHED_NORMALIZED_NUMBER')); // CACHED_NUMBER_LABEL:=cursor.getColumnIndex(StringToJstring('CACHED_NUMBER_LABEL')); // CACHED_NUMBER_TYPE:=cursor.getColumnIndex(StringToJstring('CACHED_NUMBER_TYPE')); // CACHED_PHOTO_ID:=cursor.getColumnIndex(StringToJstring('CACHED_PHOTO_ID')); // CONTENT_ITEM_TYPE:=cursor.getColumnIndex(StringToJstring('CONTENT_ITEM_TYPE')); // CONTENT_TYPE:=cursor.getColumnIndex(StringToJstring('CONTENT_TYPE')); // COUNTRY_ISO:=cursor.getColumnIndex(StringToJstring('COUNTRY_ISO')); // DATA_USAGE:=cursor.getColumnIndex(StringToJstring('DATA_USAGE')); DATE:=cursor.getColumnIndex( TJCallLog_Calls.JavaClass.DATE ); // DEFAULT_SORT_ORDER:=cursor.getColumnIndex(StringToJstring('DEFAULT_SORT_ORDER')); DURATION:=cursor.getColumnIndex( TJCallLog_Calls.JavaClass.DURATION ); // EXTRA_CALL_TYPE_FILTER:=cursor.getColumnIndex(StringToJstring('EXTRA_CALL_TYPE_FILTER')); // FEATURES:=cursor.getColumnIndex(StringToJstring('FEATURES')); // IS_READ:=cursor.getColumnIndex(StringToJstring('IS_READ')); // LIMIT_PARAM_KEY:=cursor.getColumnIndex(StringToJstring('LIMIT_PARAM_KEY')); // NEW:=cursor.getColumnIndex(StringToJstring('NEW')); // NUMBER:=cursor.getColumnIndex(StringToJstring('NUMBER')); // NUMBER_PRESENTATION:=cursor.getColumnIndex(StringToJstring('NUMBER_PRESENTATION')); // OFFSET_PARAM_KEY:=cursor.getColumnIndex(StringToJstring('OFFSET_PARAM_KEY')); // PHONE_ACCOUNT_COMPONENT_NAME:=cursor.getColumnIndex(StringToJstring('PHONE_ACCOUNT_COMPONENT_NAME')); // PHONE_ACCOUNT_ID:=cursor.getColumnIndex(StringToJstring('PHONE_ACCOUNT_ID')); // NUMBER_PRESENTATION:=cursor.getColumnIndex(StringToJstring('NUMBER_PRESENTATION')); // TRANSCRIPTION:=cursor.getColumnIndex(StringToJstring('TRANSCRIPTION')); // TYPEX:=cursor.getColumnIndex(StringToJstring('TYPE')); while (cursor.moveToNext) do begin // CACHED_FORMATTED_NUMBERx:=JStringToString(cursor.getString(CACHED_FORMATTED_NUMBER)); // CACHED_LOOKUP_URIx:=JStringToString(cursor.getString(CACHED_LOOKUP_URI)); // CACHED_MATCHED_NUMBERx:=JStringToString(cursor.getString(CACHED_MATCHED_NUMBER)); CACHED_NAMEx:=JStringToString(cursor.getString(CACHED_NAME)); // CACHED_NORMALIZED_NUMBERx:=JStringToString(cursor.getString(CACHED_NORMALIZED_NUMBER)); // CACHED_NUMBER_LABELx:=JStringToString(cursor.getString(CACHED_NUMBER_LABEL)); // CACHED_NUMBER_TYPEx:=JStringToString(cursor.getString(CACHED_NUMBER_TYPE)); // CACHED_PHOTO_IDx:=JStringToString(cursor.getString(CACHED_PHOTO_ID)); // CONTENT_ITEM_TYPEx:=JStringToString(cursor.getString(CONTENT_ITEM_TYPE)); // CONTENT_TYPEx:=JStringToString(cursor.getString(CONTENT_TYPE)); // COUNTRY_ISOx:=JStringToString(cursor.getString(COUNTRY_ISO)); // DATA_USAGEx:=JStringToString(cursor.getString(DATA_USAGE)); DATEx:=JStringToString(cursor.getString(DATE)); // DEFAULT_SORT_ORDERx:=JStringToString(cursor.getString(DEFAULT_SORT_ORDER)); DURATIONx:=JStringToString(cursor.getString(DURATION)); // EXTRA_CALL_TYPE_FILTERx:=JStringToString(cursor.getString(EXTRA_CALL_TYPE_FILTER)); // FEATURESx:=JStringToString(cursor.getString(FEATURES)); // IS_READx:=JStringToString(cursor.getString(IS_READ)); // LIMIT_PARAM_KEYx:=JStringToString(cursor.getString(LIMIT_PARAM_KEY)); // NEWx:=JStringToString(cursor.getString(NEW)); // NUMBERx:=JStringToString(cursor.getString(NUMBER)); // NUMBER_PRESENTATIONx:=JStringToString(cursor.getString(NUMBER_PRESENTATION)); // OFFSET_PARAM_KEYx:=JStringToString(cursor.getString(OFFSET_PARAM_KEY)); // PHONE_ACCOUNT_COMPONENT_NAMEx:=JStringToString(cursor.getString(PHONE_ACCOUNT_COMPONENT_NAME)); // PHONE_ACCOUNT_IDx:=JStringToString(cursor.getString(PHONE_ACCOUNT_ID)); // NUMBER_PRESENTATIONx:=JStringToString(cursor.getString(NUMBER_PRESENTATION)); // TRANSCRIPTIONx:=JStringToString(cursor.getString(TRANSCRIPTION)); // TYPEXx:=JStringToString(cursor.getString(TYPEX)); CallTime := StrToDateTime(DATEx); <- THIS DON'T WORK! Result := CACHED_NAMEx + ' ' + FormatDateTime('dd.mm.yyyy hh:mm:ss', CallTime) + ' ' + DURATIONx; ShowMessage(Result); end;
  24. erva

    Date in Android call log

    Solved the problem. Code is not "optimised" but works: CallTimeDouble := StrToInt64(DATEx) / 1000; //Gives seconds CallTimeDouble := CallTimeDouble / 60; //Gives Minutes CallTimeDouble := CallTimeDouble / 60; //Gives hours CallTimeDOuble := CallTimeDouble / 24; //Gives dates CallTimeDouble := CallTimeDouble + 25569; //01.01.1970 - 30.12.1899 CallTimeDouble := CallTimeDouble + 0.125; //Added +3h to GMT, Finland Result := CACHED_NAMEx + ' ' + NUMBERx + ' ' + FormatDateTime('dd.mm.yyyy hh:mm:ss', CallTimeDouble) + ' ' + DURATIONx; ShowMessage(Result);
  25. erva

    Date in Android call log

    I asked same question in Stackoverflow: https://stackoverflow.com/questions/61332432/delphi-getting-android-call-logs-date?noredirect=1#comment108504919_61332432 There's mentioned that value is number of millisecond since January 1, 1970, 00:00:00 GMT. This gets complicated....
×