• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Very simple Webview app in Android Studio 3.4.2

Marodo

Lurker
Hi,

I have a website and I want an android app that opens the site so that the site is available on play store. I've got Android Studio 3.4.2 (new to app dev).

Can anyone provide example script that will cause the app to display my site (but not I n a browser, or with a top title).

Thanks!
 
The following might give you a start. You'll need to modify it to remove the title, but it's a start...

Java:
public class MainActivity extends AppCompatActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WebView webView;
        webView = findViewById(R.id.simpleWebView);

        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("https://domain.com/");
    }
}
 
Back
Top Bottom