Jump to content

erva

Members
  • Content Count

    45
  • Joined

  • Last visited

Posts 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. 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:

    image.thumb.png.27cdc0ac27b7917511ef78eef8e1b5f7.png

     

    And during compilation this windows appears:

    image.thumb.png.69df239873cfd57947f42141eb333c4a.png

     


  3. 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

     

    image.png.1b716d877bbd66fd8b659c8bbf516844.png


  4. 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.

     

    Now finally managed to get records in descending order creating index at IndexDef and setting IndexName property to created index.

     

    But how to refresh index when changing records at StringGrid. Calling table.Close and after that table.Open methods didn't change records order. Tryed table.Refresh also but with no help.

     

    I'am using RemObjects DA but i guess there's properties and methods like in other TDataSet related stuff like FireDAC. 


  5. 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?


  6. 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.


  7. 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.


  8. 16 hours ago, CarioJr said:

    I tried in android studio, it works in versions below 9. But my client have a galaxy s30 with the android 10. In him The number came null

    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.


  9. On 5/4/2020 at 5:22 PM, CarioJr said:

    Do you set the function on a timer, where do you call her? I can read the log but, it is comming with  all call logs, Can i bring just the last ones?

    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?


  10. 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.


  11. 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.....

     


  12. 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);

×