Google maps link is opening in webview and not in app - android

I have made an android app in WebView. When I open a Google maps link, it's opening in WebView and not in the Google app. How can I fix this? I have searched on Google and on Stack Overflow but can't find the any solution.
Code:
public class FullscreenActivity extends Activity {
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fullscreen);
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new myWebClient());
webView.loadUrl("http://www.mywebsite.nl/");
webView.setVerticalScrollBarEnabled(false);
}

Related

Android Studio - Video Volume Low

I have taken a web page which has several videos that show in modals and put it in a WebView. When I open this page on my laptop I get full volume. When I launch the app and try to view the video I don't see video controls and the sound on the tablet is turned all the way up, yet it is very quiet. What am I missing here?
The WebView
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.webviewid);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("file:///android_asset/index.html");
}
}
Turn JavaScript On for the WebView.
mWebView.getSettings().setJavaScriptEnabled(true);

Integrating Google Forms in Android WebView, SignIn button not working

I am working on my first android project which is based on Google Forms.
I've done pretty much everything except my main part which is showing forms in webview. The form is getting display but the Sign In button is not clickable.
public class cadexpo extends AppCompatActivity {
private static WebView browser;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cadexpo);
browser = (WebView) findViewById(R.id.webView);
browser.getSettings().getJavaScriptEnabled();
WebSettings browser = browser.getSettings();
browser.loadUrl("https://drive.google.com/open?id=1VLKIncq9bTJnWqxbOHc3foTeSLykP7AQyL0Si1cIQ1I");
Please help me in fixing it.
Enable javascript for webview
WebSettings webSettings = browser.getSettings();
webSettings.setJavaScriptEnabled(true);

YouTube embedded video won't show fullscreen button in webview

I am new to Android development and I am trying to make an app for my video website which has videos from YouTube.
The problem I am having right now is that the embedded iframe videos don't show the fullscreen button. I have been searching for a solution but have yet to find one that works for me.
mainActivity.java:
public class MainActivity extends Activity {
private WebView wv1;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mWebView = (WebView) findViewById(R.id.webView);
WebView myWebView = (WebView) findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
wv1=(WebView)findViewById(R.id.webView);
wv1.setWebChromeClient(new WebChromeClient() {
});
wv1.setWebViewClient(new MyBrowser());
wv1.loadUrl("http://m.youtube.com");
} .....
Thanks for any help.

My first android app.. custom css

I'm trying to make an app with a webview of facebook.com, i want to load custom css but i don't know how. I searched on Google but found old tutorials and i read that it has changed in Android Studio 2.0
Here is my code:
private WebView myWebView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myWebView = (WebView)findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("https://www.facebook.com/");
myWebView.setWebViewClient(new WebViewClient());
}

Android: WebView - Open Links

I'm new with Android, so maybe someone can help me.
I have loaded an external URL in WebView.
I want that the links from my site http://www.domanin.com/about.php to open in WebView and the external link http://www.anotherdomanin.com/sample.php to open in default browser.
My code:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MyWeb = (WebView) findViewById(R.id.webView);
MyWeb.getSettings().setJavaScriptEnabled(true);
MyWeb.getSettings().setSaveFormData(true);
MyWeb.loadUrl("http://www.domanin.com");
}

Categories

Resources