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

The Importance of Live Score Updates

Instant Gratification Let's face it---waiting is hard. Imagine you're following an intense cricket match between…

4 days ago

How SerialGossip Shapes Public Perception Today

Hey there, ever wondered how the stories we read about our favorite celebrities and pop…

4 days ago

What to Expect in BhagyaLakshmi’s Future Episodes

The storyline of BhagyaLakshmi never fails to keep us hooked with its intriguing twists and…

4 days ago

Jhanak Written Update: Plot Twists Revealed

Hey there, fellow Jhanak fans! If you're anything like me, you're probably on the edge…

4 days ago

Discovering Your Soulmate Through Art

A soulmate sketch is more than just a drawing-it's a window into the depths of…

4 days ago

Understanding USCIS Translation Requirements for Applications

When you're submitting documents to USCIS, any document that isn't in English must be accompanied…

1 week ago