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
If you're tired of spending countless hours in front of the mirror perfecting your look,…
Salon home services bring the pampering right to your living room. Imagine getting a haircut,…
Choosing the right salon is like finding the perfect book—when you discover the right one,…
Hey there! If you're looking to boost your English skills, especially in a business context,…
Hello, fellow vapers and the vape-curious! If you find yourself wandering through the expansive universe…
By John Kaweske Hey there! So, have you ever wondered what Brazil is up to…