in this android studio tutorial we will how to use WebView to Convert website into android app ..
//////////////////////////////////////////////////////////////////////////////////////////////
java file :-
package com.example.gaurang.website;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
private WebView website;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
website=findViewById(R.id.website);
website.loadUrl(“https://www.apple.com/imac/”);
website.setWebViewClient(new WebViewClient());
}
@Override
public void onBackPressed() {
if (website.canGoBack()) {
website.goBack();
} else {
super.onBackPressed();
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////
permission to be given in Android_Menifest file :-
uses-permission android:name=”android.permission.INTERNET”
#convert_website_into_android_app
#website_to_app
#webview in android studio
source
In our extensive research and analysis, we have identified the top 5 exciting slots that…
Before we jump into the list, you might be wondering why you should consider playing…
Commercial furniture plays a crucial role in defining the atmosphere and efficiency of your workspace.…
What Is a Loaner Car? A loaner car is a temporary replacement vehicle provided by…
Introduction Poker has long been more than just a card game—it’s a world where strategy,…
Buying a vehicle gives you freedom, convenience, and flexibility. Whether it’s an initial car or…