If you want to create an android app of some website then you can do it in Android Studio following below steps:
FILE NAME: activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/kingsoftware"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
Note: Give id according to your project. You have to give id by yourself in code.
FILE NAME: MainActivity.java
package com.example.kingsoftware_vacancy;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
private WebView mykingsoftware;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mykingsoftware = (WebView)findViewById(R.id.kingsoftware);
WebSettings webSettings = mykingsoftware.getSettings();
webSettings.setJavaScriptEnabled(true);
mykingsoftware.loadUrl("https://kingsoftware.co.in/Vacancy");
mykingsoftware.setWebViewClient(new WebViewClient());
}
@Override
public void onBackPressed(){
if (mykingsoftware.canGoBack()){
mykingsoftware.goBack();
}else {
super.onBackPressed();
}
}
}
Note: You don't have to write import file manually, it will automatically added when you write the code. You just have to click on suggestion of methods while writing the code.
//Code to add
<uses-permission android : name = "android.permission.INTERNET">
</uses-permission>