1

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?

Ab Majeed
  • 106
  • 4
Beaker
  • 11
  • 3
  • Please be more specific. By "The UNIDAC MySQL Connection is working too, but seems to need no further permissions" what do you mean? Are there any errors? If so, provide details – Dave Nottage Aug 15 '18 at 20:23
  • No Errors... The mySQL connection is working without problems... I can get no connection to the local sqllite database when i'm using android level 26 ... If i push back to level 14 the sqlite connection works fine... – Beaker Aug 16 '18 at 08:34
  • "I can get no connection to the local sqllite database when i'm using android level 26". What do you mean by "I can get no connection"? Like I said, be more specific. – Dave Nottage Aug 16 '18 at 09:20
  • if i using the unidac command to connect with the local database (SQLiteConnection1.connected :=true) the App crashes without any error. On SDK14 no crash - connection ok. – Beaker Aug 17 '18 at 08:53
  • I expect you will need to contact DevArt support (makers of UniDAC): https://www.devart.com/litedac/support.html, because the FireDAC connection connects to a SQLite database OK when targeting API 26 – Dave Nottage Aug 19 '18 at 03:29

1 Answers1

0

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;
Muhammad Zahab
  • 1,049
  • 10
  • 21