samedi 20 février 2016

HTML5 in Delphi XE8 native Android browser do not work

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 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.

Have some one an ideia to enlight me?




Aucun commentaire:

Enregistrer un commentaire