To create this app, you will need to implement two activities:
- Splash Screen (utilize a timer to transition to the next activity after a set duration)
- Main
In the main activity, make sure to include a layout with a webView by adding the following code snippet:
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
Next, add this code in your main activity:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://www.google.com");
}
Don't forget to include the necessary permission in your manifest file:
<uses-permission android:name="android.permission.INTERNET" />
If you want to disable the title bar, add the following line:
<activity android:name=".Main" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
For more detailed guidance, refer to the official documentation. An example similar to this can be found on Google's tutorial page at http://developer.android.com/resources/tutorials/views/hello-webview.html