Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: HTML5 in Delphi XE8 native Android browser do not work


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Ricardo Trevisan

Posts: 6
Registered: 5/2/12
HTML5 in Delphi XE8 native Android browser do not work  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2016 8:52 AM
I am creating a app with XE8 to android. App will use the Android Native browser browsing MY OWN web site and must to have a photo upload from mobile camera. These are the only needs.

I am using HTML5 <input type="file" accept="image/*" capture="camera"> to get camera picture. I can change this if there is a better choise.

Problem is this HTML5 comand don't work in Android.

I added comands in FMX.WebBrowser.Android.pas:

procedure TAndroidWebBrowserService.InitUIThread;
begin
     FJWebBrowser := TJWebBrowser.JavaClass.init(SharedActivity);
     FJWebBrowser.getSettings.setJavaScriptEnabled(True);
     FListener := TWebBrowserListener.Create(Self);
     FJWebBrowser.SetWebViewListener(FListener);
     FJNativeLayout := TJNativeLayout.JavaClass.init(SharedActivity,MainActivity.getWindow.getDecorView.getWindowToken);
     FJNativeLayout.setPosition(100,100);
     FJNativeLayout.setSize(300,300);
     FJNativeLayout.setControl(FJWebBrowser);
     FFocusChangeListener := TFocusChangeListener.Create(Self);
     FJNativeLayout.setOnFocusChangeListener(FFocusChangeListener);
     FJWebBrowser.getSettings.setBuiltInZoomControls(True);
     FJWebBrowser.getSettings.setDisplayZoomControls(False);
// adding begin
     FJWebBrowser.getSettings.setAllowFileAccess(True);
     FJWebBrowser.getSettings.setAllowContentAccess(True);
     FJWebBrowser.getSettings.setAllowFileAccessFromFileURLs(True);
     FJWebBrowser.getSettings.setAllowUniversalAccessFromFileURLs(True);
//adding end  
end;

These adds was not enough. App still not executing HTML5 commands.

Some one have some ideia to enlight me?

Thank you

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02