I have a website with this structure
<html>
<head></head>
<body>
<script src=".style/js/javascript.js"></script>
<link rel="stylesheet" href="./style/css/ipars.css" />
</body>
</html>
I want host js and css (with css inline images) locally in android app. So I create a www folder in assect folder and then move style folder in it. and then I change code to this:
<html>
<head></head>
<body>
<script src="file:///android_asset/www/style/js/javascript.js"></script>
<link rel="stylesheet" href="file:///android_asset/www/style/css/ipars.css" />
</body>
</html>
Now I browse my website with webview But js and css do not work!
this is my java code in android-studio:
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v =inflater.inflate(R.layout.tab_1, container, false);
WebView webView = (WebView) v.findViewById(R.id.webview1);
// for wepars.com php
String agentModified = webView.getSettings().getUserAgentString().concat(" MobileApplication(com.wepars.webapp)");
webView.getSettings().setUserAgentString(agentModified);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("http://www.example.com");
return v;
}
what is my wrong?
edit/ not dublicate: I checked the link. it is for local html. I want do it for a remote html.