Android Question Solve the webview subfolder problem in Android 30

parswp

Member
Hello All,

I was able to solve the sub folder problem in Android 30 using the APK Easy Tool

I think this problem is from the B4A side

Please review and resolve this issue

Thank you
 

Ivica Golubovic

Active Member
Licensed User
And what's the problem? I don't think anyone understands the essence of your question or whatever. Be a little more specific in describing the problem and don't immediately say that the problem is in B4A.
 
Upvote 0

parswp

Member
And what's the problem? I don't think anyone understands the essence of your question or whatever. Be a little more specific in describing the problem and don't immediately say that the problem is in B4A.
hi
The problem Webview subfolder on Android 30


I could fix the problem using Decompile and Compile by the APK Easy Tool program
How can this problem fix in B4A?
I hope you have noticed
 

Attachments

  • Untitled-1.jpg
    Untitled-1.jpg
    50.9 KB · Views: 120
  • ezgif-6-9c351b36e5.jpg
    ezgif-6-9c351b36e5.jpg
    18.9 KB · Views: 127
  • 2.jpg
    2.jpg
    168.6 KB · Views: 126
  • 3.jpg
    3.jpg
    69.8 KB · Views: 131
Upvote 0

parswp

Member
If I understood you correctly, you want to open in WebView an HTML file from File.DirAssets or File.DirInternal on Android SDK 30?
Yes. That's right
The subfolder does not work on Android SDK 30.
But with the (APK-Easy-Tool) program this problem is resolved
Look at the attached photo
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
i think op is maybe talking about file:// scheme for sdk30. #3.jpg above is a screen cap from my webviewassetloader library example which addresses that and the webviewclient setting workaround that does allow it (at least for sdk30). his post so vague though.
 
Upvote 0

parswp

Member
i think op is maybe talking about file:// scheme for sdk30. #3.jpg above is a screen cap from my webviewassetloader library example which addresses that and the webviewclient setting workaround that does allow it (at least for sdk30). his post so vague though.
hi

subfolders webviewassetloader and file:// scheme for sdk30 is problem
The subfolder does not work on Android SDK 30.

file:///android_asset/subfolder/cat1/test.jpg
it seems I cannot read from that subfolder anymore any idea on SDK30 why ?

But with the (APK-Easy-Tool) program, subfolder on Android SDK 30 is resolved
 
Upvote 0

Ivica Golubovic

Active Member
Licensed User
The easiest way is to copy all folders and files from DirAsset to Shared Folder at the very beginning of the code. This mode works on all SDK versions.
 
Upvote 0

parswp

Member
The easiest way is to copy all folders and files from DirAsset to Shared Folder at the very beginning of the code. This mode works on all SDK versions.
This apps are on sdk30, and have subfolder.

apk bug subfolder --> https://mega.nz/file/22gknQIR#1OErSWsqJzY_u5NnchkmynrMD4Y7OEgHeKiPd6LmRPk

apk fix subfolder --> https://mega.nz/file/vu4GiQ5A#AxjIdPHXgWwLcnCwbFTfdThLXbEm34xY_kME67tIi_4

Bug Subfolder was created from B4A 10.7 up to latest version
Please install to understand
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
users who have found themselves in the situation of being unable to load a webview with files from a tree-structured assets folder beginning with api 30 have been reluctant to abandon that structure. it isn't absolutely necessary, and it doesn't take much for them to continue as if nothing has happened with api 30. since none of us knows what google will do next to restrict our movements in our own devices, i say let's enjoy life while we can:cool:.

attached plus find 1 way to continue loading files in a webview from resources in the assets folder with one or more subfolders.
the op mentions: dirassets/subfolder/cat1/ as his "file" structure. i have duplicated that in my example. there is a screen capture showing that, as well as a screen cap of the result of loading 2 files from dirassets/subfolder/cat1: an html file and a .jpg. the app loads the html file, and the webview loads the image.

i tested with a device running android 12 / api 30 and on a device running android 9 / api 28. i also tried it on the android 12 device with api 28.
 

Attachments

  • assets.zip
    45.6 KB · Views: 128
  • cap1.png
    cap1.png
    117 KB · Views: 108
  • cap2.png
    cap2.png
    14.6 KB · Views: 117
Upvote 0
Top