Jump to content

programmerdelphi2k

Members
  • Content Count

    1406
  • Joined

  • Last visited

  • Days Won

    22

programmerdelphi2k last won the day on July 2 2023

programmerdelphi2k had the most liked content!

Community Reputation

235 Excellent

4 Followers

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

4338 profile views
  1. programmerdelphi2k

    App persistence and restoring state

    let's imagine a "regular case" = no critical-crash on the system! the app, would try receive the "message": hey app goes down! then, the form/app/OnClose...Destroy will be trigged this can be seen on MSWindows because it's more easy, on Android it's necessary more knowledge about how happens... I dont know! but you can do the tests... then, if you have the events "OnClose" (for example), you can to do some "quick"-task ... not save 1BILLION records of course! SQLite it's a DB one-file with many internal resource, then, you need read the documentation about your doubts. maybe not, maybe yes... maybe your code be the "bug"... needs more details/code and somebody that know how Android works behind the scenes... your code, how do you call the another app into your app? it's possible show the code?
  2. programmerdelphi2k

    TScrollBox contents order

    sometimes, it's necessary ALIGN = NONE!!! then with your "PARENT" defined, now you can put on the position out this control! you see? after this, you can (again) re-align to TOP or BOTTOM, as you need first, define the Parent later, define align=none position=x (out this control, maybe xControl.Top (absolute position on screen) + xControl.Height + NNNN) -> if your xControl is into a another control, use this control-parent to get the values) re-define align to Top or Bottom
  3. programmerdelphi2k

    App persistence and restoring state

    and if you "assign" to current FORM active? unassign for any other... or be, only when you go to MAPs, you assign it, later unassign it! the app above is a FMX in MSWindows, not VCL!!!! then when app end, the SaveState is called as expected
  4. programmerdelphi2k

    TScrollBox contents order

    @David P did you try, before insert the items, define the property position "Y" (or X if horizontally), before that define the "alingment"? for example: -(value out of screen) (negative or positive) value to position?
  5. programmerdelphi2k

    App persistence and restoring state

    Another thing: as you use FDMemTable (I think), then, you can save your data on JSON/XML file using the properties for that: ResourceOptions ->PersistentFileName + Persistent=true then, when you re-open your table, the data should be there!
  6. programmerdelphi2k

    App persistence and restoring state

    by default, the all "SaveState" is transitory (tmp), then, you can try save it permanently on disk using: xxSaveState;Name := 'xxxxx'; xxSaveState.StoragePath := 'xxxx'; like this: create your FOLDER before save it!!!! ALL components should exists on form as exists on SaveState file!!! // here Im not take care about "AV" ok? do it yourself... implementation {$R *.fmx} procedure TForm1.Button1Click(Sender: TObject); begin // you can use this on "OnCreate" from "form1"... or any place that you desire! // SaveState.Name := 'mySaves.TMP'; SaveState.StoragePath := 'd:\mytmpSaveStateDir'; // if SaveState.Stream.Size > 0 then begin for var i: integer := 0 to (ComponentCount - 1) do SaveState.Stream.ReadComponent(Components[i]); // reading... // ShowMessage('SaveState size on disk: ' + SaveState.Stream.Size.ToString); end else; end; procedure TForm1.FormSaveState(Sender: TObject); begin // 1º FormCloseQuery // 2º FormClose // 3º FormSaveState <---- // 4º FormDestroy // ... SaveState.Stream.Clear; SaveState.Name := 'mySaves.TMP'; // in disk, it will be [ ~project1_ + "your name to SaveState" ] SaveState.StoragePath := 'd:\mytmpSaveStateDir'; // for var i: integer := 0 to (ComponentCount - 1) do SaveState.Stream.WriteComponent(Components[i]); // saving all components on "Form1" // ShowMessage('FormSaveState fired'); end; end.
  7. programmerdelphi2k

    FireDAC Create table with TFDTable class at SQL Postgres 14

    I dont use PG, then "schema" is really necessary in your definition, say, here: "vTable.SchemaName:='test_schem'; "
  8. programmerdelphi2k

    FireDAC Create table with TFDTable class at SQL Postgres 14

    here "LOGIN" shouldnt be quoted too?
  9. programmerdelphi2k

    Android Foreground Server location access blocked

    Have you seen this in my code? ... initialization LLocationForegroundPermission := [ { ARRAY } 'android.permission.ACCESS_COARSE_LOCATION', { } 'android.permission.ACCESS_FINE_LOCATION' { } ]; // LLocationBackgroundPermission := [ { ARRAY } 'android.permission.ACCESS_BACKGROUND_LOCATION' { in Android 11, you'll can see your "Allow all the time" option!!! } ];
  10. programmerdelphi2k

    App persistence and restoring state

    I think that is explained here not? read about "SaveState" usage on Android apps: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/FireMonkey_Save_State
  11. programmerdelphi2k

    Handling Androids Navigation buttons

    @hackbrew read about "SaveState" usage on Android apps: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/FireMonkey_Save_State
  12. programmerdelphi2k

    Android Foreground Server location access blocked

    @Bart Kindt by default, in Android 11+++ you CANNOT ASK "foreground/background" permissions at same time!!! first one, later other! Otherwise, the Android dont use anyone!!! that way, you can : procedure TForm1.BtnForegroundClick(Sender: TObject); begin TPermissionsService.DefaultService.RequestPermissions( { } LLocationForegroundPermission, { } MyReqPerms, { } MyRatDisplay { } ); end; procedure TForm1.BtnBackgroundClick(Sender: TObject); begin TPermissionsService.DefaultService.RequestPermissions( { } LLocationBackgroundPermission, { } MyReqPerms, { } MyRatDisplay { } ); end; initialization LLocationForegroundPermission := [ { } 'android.permission.ACCESS_COARSE_LOCATION', { } 'android.permission.ACCESS_FINE_LOCATION' { } ]; // LLocationBackgroundPermission := [ { } 'android.permission.ACCESS_BACKGROUND_LOCATION' { in Android 11, you'll can see your "Allow all the time" option!!! } ];
  13. programmerdelphi2k

    Placing Child Behind Parent

    no problem... dont forget that you can move the elements beyond the containers ( negative or positive positions), background or foreground
  14. programmerdelphi2k

    Android Foreground Server location access blocked

    did you read this: https://developer.android.com/training/location/background https://developer.android.com/training/location/permissions
  15. programmerdelphi2k

    Placing Child Behind Parent

    @Mike Warren what about this idea... 1 TLayout (or any other container to Image/Rectangle) = HitTest = TRUE! then you can use Layout client-area to expand your rectangle and no needs to do nothing in Timage... doubleclick on rectangle to expand for all client-area from TLayout/container ... private FMouseMoving : boolean; FControlMouseClickPositionXY: TPointF; FRectangleSizeDefault : TRectF; public ... implementation {$R *.fmx} { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin FRectangleSizeDefault := Rectangle1.BoundsRect; end; procedure TForm1.Layout1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin FControlMouseClickPositionXY := PointF(X, Y); TControl(Sender).AutoCapture := true; FMouseMoving := true; end; procedure TForm1.Layout1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin TControl(Sender).AutoCapture := false; FMouseMoving := false; end; procedure TForm1.Layout1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); var XY: TPointF; begin if FMouseMoving then begin XY := TControl(Sender).LocalToAbsolute(PointF(X - FControlMouseClickPositionXY.X, Y - FControlMouseClickPositionXY.Y)); TControl(Sender).Position.X := XY.X; TControl(Sender).Position.Y := XY.Y; end; end; procedure TForm1.Rectangle1DblClick(Sender: TObject); begin if (Rectangle1.Align = TAlignLayout.Client) then begin Rectangle1.Align := TAlignLayout.Right; Rectangle1.BoundsRect := FRectangleSizeDefault; end else Rectangle1.Align := TAlignLayout.Client; end; end.
×