Created
May 27, 2019 14:23
-
-
Save apuravchauhan/39fae2de890ff34db71779f99bbbf315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.apuravchauhan.apuravupi; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.webkit.WebSettings; | |
import android.webkit.WebView; | |
/** | |
* @author apuravchauhan | |
*/ | |
public class MainActivity extends AppCompatActivity { | |
private WebView mWebView; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
mWebView = findViewById(R.id.activity_main_webview); | |
// Enable Javascript | |
WebSettings webSettings = mWebView.getSettings(); | |
webSettings.setJavaScriptEnabled(true); | |
mWebView.addJavascriptInterface(new WebAppInterface(this), "ApuSDK"); | |
// REMOTE RESOURCE | |
// mWebView.loadUrl("https://www.google.com"); | |
// LOCAL RESOURCE | |
mWebView.loadUrl("file:///android_asset/index.html"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment