admin管理员组文章数量:1593159
缘起:
使用手机自带的浏览器来访问unigui开发的移动网页程序,必须在手机浏览器的url地址栏中输入ip地址和port号,使用起来影响体验,如果想有像native app一样的体验,请跟随以下的步骤去体验一下。
1、下载WebViewExtras插件。
https://www.b4x/android/forum/attachments/webviewextras_v1_42-zip.38157/
2、下载WebViewSetting插件。
https://www.b4x/android/forum/attachments/webviewsettings_v_1_31-zip.23712/
3、下载demo程序。
https://www.b4x/android/forum/attachments/geolocationdemo-zip.14187/
4、编辑geolocationdemo代码。如下。
Sub Globals
Dim WebView1 As WebView
Dim WebViewExtras1 As WebViewExtras
Dim WebViewSetting1 As WebViewSettings
End Sub
Sub Activity_Create(FirstTime As Boolean)
WebView1.Initialize("WebView1")
WebView1.JavaScriptEnabled=True
WebViewExtras1.addJavascriptInterface(WebView1, "B4A") ' NOT ESSENTIAL
WebViewExtras1.addWebChromeClient(WebView1,"")
WebViewSetting1.setDatabaseEnabled(WebView1, True)
Log("DefaultWebViewDatabasePath: "&WebViewSetting1.getDatabasePath(WebView1))
WebViewSetting1.setDatabasePath(WebView1, "")
Log("NewWebViewDatabasePath: "&WebViewSetting1.getDatabasePath(WebView1))
Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
WebView1.LoadUrl("http://192.168.100.102:8077/m")
End Sub
5、运行unigui服务端程序,打开手机端b4abridge程序,pc端b4a连接手机。编译并安装。
结果。
版权声明:本文标题:为unigui程序搭建chrome手机浏览器(B4A) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1727158548a1099705.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论