Hi Erel,
I got a problem with cannot load fully map via online map link in WebView, just like the picture below:
I have had do anything i can but map still broken but no error
1. I catch the data from map via Fiddler, i found it has a little map of data loaded a few second and then it doesn't work
2. I tested it from the default broswer in the phone that the map worked smoothly. but WebView of B4A cannot work still.
3. It has location permission and others.
Could you please help me to have a look the webview?
Which permission i lost?
What can i do?
Thank you in advance!
I got a problem with cannot load fully map via online map link in WebView, just like the picture below:
I have had do anything i can but map still broken but no error
1. I catch the data from map via Fiddler, i found it has a little map of data loaded a few second and then it doesn't work
2. I tested it from the default broswer in the phone that the map worked smoothly. but WebView of B4A cannot work still.
3. It has location permission and others.
Could you please help me to have a look the webview?
Which permission i lost?
What can i do?
Thank you in advance!
Mainfest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="34"/>
<!-- 必须的网络权限 -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> ' 读取外部存储设备内容权限
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> ' 写入外部存储设备内容权限
<uses-permission android:name="android.permission.INTERNET"/> ' 访问网络权限
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/> ' 请求忽略电池优化权限
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> ' 重复声明读取外部存储权限
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> ' 重复声明写入外部存储权限
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> ' Android 11+管理所有外部存储权限
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
SetServiceAttribute(Tracker, android:foregroundServiceType, "location")
AddPermission(android.permission.FOREGROUND_SERVICE_LOCATION)
AddPermission(android.permission.ACCESS_BACKGROUND_LOCATION)
AddPermission(android.permission.RECEIVE_BOOT_COMPLETED)
AddReceiverText(StartAtBootReceiver,
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.READ_EXTERNAL_STORAGE)
AddPermission(android.permission.INTERNET)
AddApplicationText(
<activity android:name="com.anywheresoftware.b4a.objects.WebViewClientWrapper$LocalWebViewClient" />
)
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
SetApplicationAttribute(android:hardwareAccelerated, "false")
WebView Code:
Private wv As WebViewExtras
Private webview As WebView
webview.Initialize("")
wv.Initialize(webview)
Root.AddView(wv, 0, 0, Root.Width, Root.Height)
Dim filename As String="http://192.168.1.4:9996/index.html"
wv.LoadUrl(filename)