开发者

Load images or whole site from local "assets" folder using webview

开发者 https://www.devze.com 2023-01-11 15:39 出处:网络
The question I have is simple but hard to put in words, I\'ll give it a try anyways. I am trying to load a web page in webview. However, the load time is a little bit too high.

The question I have is simple but hard to put in words, I'll give it a try anyways.

I am trying to load a web page in webview. However, the load time is a little bit too high.

  • Is there any way I can put the images in the assets folder and load them from there instead?
  • If not, is there a way I can load the whole s开发者_如何学Cite from the assets folder, providing that my PHP files can still communicate with my internet database?

I have already read most tutorials, but those are pretty vague when it comes to concrete help.


try this... WebView with custom HTML and local images


There is no way to store your php files on the device itself. They need a server to execute them and sent the result to the device if the are on the device you would just show the php code to your webview and that would certainly not work.

The Webview should be able to cache some of the images itself. But it seems that there is no way to access images from the sd card or the internal storage from your webview.

Maybe it is possible to store some of your data through html5 local storage apis but I don't have any expertise on that.


Sure ! you can do it. Just install AndroPhp it is a localServer for Android.

Locate you project than on your device under the www/ folder. If you have a DB also just import your .sql trough phpmyadmin.

on Android side call you project 127.0.0.1:8080/yourProject

Thats All!

0

精彩评论

暂无评论...
验证码 换一张
取 消