简体   繁体   中英

Delphi FMX - Android API 26 - SQLite DB Connection with UniDAC

I'm using Tokyo 10.2.3 and UniDAC component for interacting with an SQLite database on Android API 26 Platform. So far, with the help from Dave:

http://www.delphiworlds.com/2018/06/targeting-android-8-and-higher-continued/

... the App worked fine with access to 'TakePhoto', 'Positioning', 'W/R to external storage'... The UniDAC MySQL Connection is working too but seems to need no further permissions.

But I can get no connection to my SQLite Database anymore. Before the change from SDK14 to SDK26, the connection worked fine. Seems to me, as it is a problem with accessing 'external' URIs as Dave described in his blog. I changed the Manifest.xml, added a file-provider and added the provider_paths.xml too.

The way of choose the Databasefile with UniDAC as String:

SQLiteConnection1.Database := TPath.Combine(TPath.GetDocumentsPath, 'test.db');

Any solutions or help outside?

Deployment path: assets\internal
Change UniConnection.Direct to true. Add UNIDAC before connection

procedure TDataModule1.UniCon_SQliteBeforeConnect(Sender: TObject);
begin
  {$IF DEFINED(iOS) or DEFINED(ANDROID)}
  DataModule1.UniCon_SQlite.Database :=
  TPath.Combine(TPath.GetDocumentsPath, 'st_pass.db');
  {$ENDIF}
end;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM