Geliştirmeye açık android webview

activity_main xml

    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">    
        android:layout_width="match_parent"
        android:id="@+id/webview"
        android:layout_height="match_parent">

---

android manifest

    package="gopsis.alfgopobsm">    
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="Gop Okulları OBS"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.NoActionBar">      

---

mainactivity java
package gopsis.alfgopobsm;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
    private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        webView = findViewById(R.id.webview);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("http://obs.gopokullari.com");
        webView.getSettings().setBuiltInZoomControls(false); //zoom yapılmasına izin verir
        webView.getSettings().setSupportZoom(false);
        webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        webView.getSettings().setAllowFileAccess(true);
        webView.getSettings().setDomStorageEnabled(true);
        webView.getSettings().setJavaScriptEnabled(true);
    }
}

Blog Kategorileri

Android Studio

HTML, CSS, JS

PHP, Codeigniter, Laravel

Visual Studio

En Son Bloglar