My MainActivity.java file looks like below:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String myUrl = "file:///android_asset/index.html";
WebView view = (WebView) this.findViewById(R.id.webView);
view.getSettings().setJavaScriptEnabled(true);
view.getSettings().setDomStorageEnabled(true);
view.getSettings().setSaveFormData(true);
view.setWebChromeClient(new WebChromeClient());
view.loadUrl(myUrl);
}
}
Now, activity_main.xml file contains following codes:
<WebView
android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
</android.support.constraint.ConstraintLayout>
And, in the html page index.html, I have been linking CSS and JS files like below:
<link rel="stylesheet" href="file:///android_asset/css/bootstrap.min.css">
<script src="file:///android_asset/js/popper.min.js"></script>
I am seeing the html content; but, the CSS and JavaScript files are not in action at all. The page looks plain. I am new to Android, I am certainly missing something crucial here.
file:///android_asset/*css and js files. You can try using CDN links of both. See getbootstrap.com/docs/3.3/getting-started/#download-cdn and cdnjs.com/libraries/react-popper