A
A
Alexander Vishnev2021-12-23 12:36:38
Android
Alexander Vishnev, 2021-12-23 12:36:38

How to open HTML file in WebBrowser for Android?

procedure Form1.ListBoxItem5Click(Sender: TObject);
var
Doc : string;
begin
   {$IF DEFINED(iOS) or DEFINED(ANDROID)}
  Doc := TPath.Combine(TPath.GetDocumentsPath, 'index.html');
  WebBrowser1.Navigate('file://'+Doc);
  {$ENDIF}
end;

I get:
Unable to open web page An error occurred
while loading the web page file:///data/user/0/com.demo.abc/files/index.html for the following reasons:
net::ERR_ACCESS_DENIED


Installed Permissions:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_USER_DICTIONARY" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hemul GM, 2021-12-23
@fromdns

See if you can just read this file from this path. For example in a memo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question