![](https://en.delphipraxis.net/uploads/set_resources_2/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://en.delphipraxis.net/uploads/monthly_2019_05/K_member_1155.png)
kabiri
-
Content Count
60 -
Joined
-
Last visited
Posts posted by kabiri
-
-
I used aes-256 in FD and leAES256 in uni.
The only similar option is this.
-
1 hour ago, Lars Fosdal said:What if you in the app, first export to json with UniDAC, then close all Unidac DB conns, and then import with FireDAC?
Because Delphi cannot deploy two libraries with the same name.
1 hour ago, Lars Fosdal said:Why can't it connect?
On Android it stops at the splash screen
FD :
uni:
-
This is possible.
But at the same time it is impossible.
Android phone users have downloaded it from Google Play.
If there were private users, this migration would be easy.
The problem is that not all users update their app at the same time.Perhaps the best way is to use a database other than sqlite.
Or rename the sqlite library (which I don't know how to do) -
It is not a problem on PC and it is easy to migrate.
There is a problem with the Android device.
The DB is on the user's Android device. -
I have old app in Android.
I have used uniDac to connect to sqlite database.
The database is encrypted using leAES256 method. FD cannot connect to it.
I need to convert database for FD.
But when I use both of these in the app, Delphi gives an error :
sqlite3.c:(.text+0xb5e8): multiple definition of `sqlite3_aggregate_context' (And many other errors)
I know the reason for the error but how to convert the database when I can't use both of them?
-
Because I did not understand the problem, I wrote with the touch event.
Now it works without problems. -
I tried that the rest of the controls do not have hittest equal to true.
I assign tap event for the form, which always works even when pan does not work.
When I enable all gestures the event always happens (but GestureID is never igipan)
-
I wrote a simple program before and it was running well.
I did exactly the same things in the main program, but sometimes when I open the form it works and sometimes it doesn't.In the main form, there are many layers and a rectangle as a background and a 3D view. Even if I hide all of them and the form remains, there is still a problem (only on IOS) I have a tap event on the form that always works.
I transferred the components of the previous program to the test program, but the test program works without problems.
I have not removed the Gesture event or changed the OnGesture event of the form anywhere in the source.
-
Sometimes in IOS when I open the form, the Gesture event does not happen.
But in Android this event always happens.
I have a form on which I have placed the GestureManager component
I have selected it in the Touch section and only the Pan option is enabled.
In the event of closing the form, I have acted as follows: Action:=TCloseAction.caFree;
And I create it every time before the show.
In the Gesture event, I have acted like this
if EventInfo.GestureID = igiPan then begin Handled := True; if TInteractiveGestureFlag.gfBegin in EventInfo.Flags then begin fPanPoint := EventInfo.Location; end else begin // end; if TInteractiveGestureFlag.gfEnd in EventInfo.Flags then begin // end; end
But in IOS, this event happens randomly.
Do you know what the problem is?
If the event happens after displaying the form, the event will happen until I close the form.
If the event doesn't happen after displaying the form, the event won't happen until I close the form. -
It depends on whether you decide to use multiple queries or joins or views.
Since the ActiveLitnerBox table only contains one record, I decided not to use join tables.
The next reason was that in older versions the DefaultCategory could be zero (but I don't want to force the user to change it to 1), but in the newer version I decided that if this value was 0, I would consider a value of 1 for it.This was not possible if I was using Join.
But it would have been better if I used if for the second query.
Writing code depends on how you look at it.
-
Thanks @programmerdelphi2k
You are right.
I migrated from uniDac to FD and forgot to put the TFDGUIxWaitCursor component on the form and set the Provider property.But putting it on the form didn't help the problem.
I noticed this happens on IOS when I call the GetDefaltCategory function on the untDataModule inside the DataModuleCreate function.
procedure TfrmDataModule.GetDefaltCategory; var qry: TFDQuery; begin qry := TFDQuery.Create(nil); qry.Connection := DBCon; qry.SQL.Clear; qry.SQL.Add('select * from ActiveBox'); try qry.Open; if not qry.IsEmpty then begin DefaultCategory := qry.fieldByname('ActiveBox').asinteger; if DefaultCategory = 0 then DefaultCategory := 1; end else DefaultCategory := -1; qry.Close; except end; // if DefaultCategory = 0 then // DefaultCategory := 1; DefaultCategoryName := ''; qry.Open; qry.SQL.Clear; qry.SQL.Add('select * from Category'); qry.SQL.Add('where id=' + DefaultCategory.ToString); try qry.Open; if not qry.IsEmpty then begin DefaultCategoryName := qry.fieldByname('Name').AsString; FreeDownload := qry.fieldByname('FreeDownload').asinteger; end; except end; qry.Close; qry.Free; end;
But when I call this function from somewhere else, there is no problem.
-
17 hours ago, programmerdelphi2k said:- you are using a "DataModule" then, there is not necessity create a "FDConnection" by code! just use a component FDConnection!
Yes , i khow. but when a put TFDConnection on the form delphi add "FireDAC.VCLUI.Wait" to DataModule unit!!!
I add FireDAC.FMXUI.Wait myself, but it didn't help. That's why I didn't put the component on the form.
This code is also {%CLASSGROUP 'FMX.Controls.TControl'} in the unit.
I even created a new form Datamodule and it was the same.
-
Create database :
procedure TfrmDataModule.DataModuleCreate(Sender: TObject); var DBN: string; NewDb: Boolean; pth: string; applayUpdate: Boolean; newVersion: Integer; begin DBCon:=TFDConnection.Create(Self); qryTmp.Connection:=DBCon; newVersion := 14; DBN := 'myDB.db3'; {$IF Defined(MSWINDOWS)} pth := ExtractFilePath(ParamStr(0)) + DBN; {$ENDIF} {$IF Defined(ANDROID)} pth := GetHomePath + '/' + DBN; {$ENDIF} {$IF Defined(IOS)} pth := TPath.Combine(TPath.GetDocumentsPath, DBN); {$ENDIF} DBCon.Close(); DBCon.DriverName := 'SQLite'; with DBCon.Params as TFDPhysSQLiteConnectionDefParams do begin DriverID:='SQLite'; Database:=pth; Password:='159753'; Encrypt:=TFDSQLiteEncrypt.enAes_256; end; if not FileExists(pth) then begin NewDb := True; end else begin NewDb := False; end; DBCon.Open; {$REGION 'Database'} if NewDb then begin qryTmp.SQL.Clear; qryTmp.SQL.Add ('CREATE TABLE [Category] ([ID] INTEGER PRIMARY KEY AUTOINCREMENT'); qryTmp.SQL.Add(',[ServerCategoryID] INTEGER'); qryTmp.SQL.Add(',[FreeDownload] INTEGER'); qryTmp.SQL.Add(',[Name] NVARCHAR(200) NOT NULL);'); try qryTmp.ExecSQL; except end; . . . //other tables qryTmp.SQL.Clear; qryTmp.SQL.Add('insert into version (ver) values (' + inttostr(newVersion) + ')'); try qryTmp.ExecSQL; except end; FirstRun := True; end else begin FirstRun := False; applayUpdate := False; //update table here for example if Version <= 13 then begin qryTmp.SQL.Clear; qryTmp.SQL.Add('alter TABLE Category add COLUMN [FreeDownload] INTEGER;'); try qryTmp.ExecSQL; except end; qryTmp.SQL.Clear; qryTmp.SQL.Add('update Category set FreeDownload=1'); try qryTmp.ExecSQL; except end; qryTmp.SQL.Clear; qryTmp.SQL.Add('CREATE TABLE WorkTime('); qryTmp.SQL.Add('[Date_] string(10)'); qryTmp.SQL.Add(',[TimeInSec] INTEGER);'); try qryTmp.ExecSQL; except end; applayUpdate := True; end; if applayUpdate then begin qryTmp.SQL.Clear; qryTmp.SQL.Add('update version set ver=' + inttostr(newVersion)); try qryTmp.ExecSQL; except end; end; end; GetDefaltCategory; //GetTotalTime; end;
-
48 minutes ago, programmerdelphi2k said:what is done (code) on DM.Create(...)?
Yes
-
On 12/22/2022 at 1:40 PM, Dave Nottage said:Earlier, you said:
Sorry, I forgot that
I rewrote untMain from scratch and it only has the TfrmMain.FormCreate event. Now the breakpoint works.
Now the event time of TfrmDataModule.DataModuleCreate ends, the program stops in the System.Generics.Collections unit, I have not put a breakpoint here.I didn't understand anything from Call Stack which routine made me go here
-
10 hours ago, Dave Nottage said:Yet when you removed that part, the code in unit main executes?
No, It does not run
-
Maybe the problem is Delphi.
Because I recently had several problems with the IDE (especially after installing the patch).The back button does not work in the toolbar
Also these buttons. I use a shortcut:
Sometimes I see the selection form like this in the settings:
When I change the platform in the toolbar, it does not change in the project manager panel. Exactly like this:
https://quality.embarcadero.com/browse/RSP-30799?jql=text ~ "select platform"
-
-
18 minutes ago, Dave Nottage said:Something specific to the platform. Detailing what you have in your datamodule might help (eg. data components used, what type of connection e.g SQLite, etc)
In the DataModuleCreate function, if the sqlite database and tables do not exist, they are created. This part apparently runs without errors because it works correctly during debugging and the first time it creates the tables and inserts the default value, and the second time the app is run it receives the information from the tables correctly.
18 minutes ago, Dave Nottage said:There's a difference between a breakpoint being disabled (which is indicated visually), versus one where the debugger does not stop. The latter can happen because the code where you have the breakpoint is never reached and/or you have a unit with the same name, and you're looking at the wrong one.
If I put breakpoints in all lines of unit main, it doesn't make any difference and the execution doesn't stop at breakpoints.
-
3 minutes ago, Dave Nottage said:Still? The screenshot you showed in an earlier message indicates they were not. Are you compiling for Debug?
Yes, it is in debug mode. Breakpoint works in other forms, but it does not work in this form(frmMain/untMain)
6 minutes ago, Dave Nottage said:So the problem is with the datamodule.
What could be the problem that only happens on IOS?
-
The previous post was about 2 hours ago, I don't know why it was not sent!
@Dave Nottage & @programmerdelphi2k Thankful
Yes, I had tried the blank project, it work.One of the problems is that the main file is not debugged.
I first tested the things I knew, then I asked a question here because I couldn't debug.
I don't know why unit main is not traceable and debug is disabled only in this form.
-
7 hours ago, programmerdelphi2k said:verify if any component is trying access your database - verify DB connection if true on design-time or in some place?
DB is created at runtime and does not exist at design time. But to be sure, I checked its connection value is False.
In TfrmMain.FormCreate and TfrmMain.FormShow TfrmMain.FormActivate events, I have nothing to do with the database.
7 hours ago, programmerdelphi2k said:it's preferable dont create all forms/datamodules automatically! try create it after main-form on memory!
begin Application.Initialize; Application.CreateForm(TfrmMain, frmMain); Application.Run; end.
procedure TfrmMain.FormCreate(Sender: TObject); begin //Application.Create(TfrmDataModule, frmDataModule); frmDataModule:=TfrmDataModule.Create(self); isEmpty:=True;
I gave these changes and it didn't make any difference.
Line frmDataModule:=TfrmDataModule.Create(self); I deleted
Now it displays the main form, but breakpoints are still disabled. -
I had an app that works well on Android and Windows.
I added the IOS platform yesterday. But the program remains on the splash screen.
uses System.StartUpCopy, FMX.Forms, untMain in 'untMain.pas' {frmMain}, untDataModule in 'untDataModule.pas' {frmDataModule: TDataModule}, untAddTitle in 'untAddTitle.pas' {frmAddTitle: TFrame}, untCategoryList in 'untCategoryList.pas' {frmCategory: TFrame}, untPlay in 'untPlay.pas' {frmPlay}, {$IFDEF android} Androidapi.JNI.Toast in 'Androidapi.JNI.Toast.pas', {$endif} untServerCategory in 'untServerCategory.pas' {frmServerCategory}, untReport in 'untReport.pas' {frmReport}, untSelectCategoryList in 'untSelectCategoryList.pas' {frmSelectCategoryList}, untCategoryItem in 'untCategoryItem.pas' {frmCategoryItem: TFrame}, untHelp in 'untHelp.pas' {frmHelp}; {$R *.res} begin Application.Initialize; Application.CreateForm(TfrmDataModule, frmDataModule); Application.CreateForm(TfrmMain, frmMain); Application.CreateForm(TfrmPlay, frmPlay); Application.CreateForm(TfrmServerCategory, frmServerCategory); Application.CreateForm(TfrmSelectCategoryList, frmSelectCategoryList); Application.CreateForm(TfrmHelp, frmHelp); Application.Run; end.
All FormCreate events except frmMain are executed.
When I change the main form in the project settings and select another form, it displays that form.
-
12 hours ago, Dave Nottage said:You would have needed to have downloaded your developer profile, so I was assuming you knew how already.
I have already downloaded the certificates. And I have installed in Keychain Access.
But I didn't know where to copy the profile I made.
For this reason, I copied the JalaliCalender.mobileprovision file next to the project file (JalaliCalender.dproj).
[Problem] Convert DB from unidac sqlite to FD sqlite
in FMX
Posted
The settings are almost the same