Categories: ANDROID APP

Use WebView to Convert any website into Android App | Android studio tutorial ..



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

linda

Recent Posts

Top 5 Exciting Slots to Play Today

In our extensive research and analysis, we have identified the top 5 exciting slots that…

2 days ago

Top Unblocked Snowboard Games to Play

Before we jump into the list, you might be wondering why you should consider playing…

2 days ago

Choosing the Right Commercial Furniture for Your Business

Commercial furniture plays a crucial role in defining the atmosphere and efficiency of your workspace.…

2 days ago

Loaner Car: Everything You Need to Know About a Loaner Car

What Is a Loaner Car? A loaner car is a temporary replacement vehicle provided by…

3 days ago

The Biggest Poker Prizes in History

Introduction Poker has long been more than just a card game—it’s a world where strategy,…

6 days ago

Affordable and Flexible Auto Loans at Haverhill Bank

Buying a vehicle gives you freedom, convenience, and flexibility. Whether it’s an initial car or…

6 days ago