Android webview to work like native browser - android

I experimenting with WebView in Android and I can't figure out how to make it work like the native browser.
I have an example for this:
Go to deviantART.com in native browser. Press Menu button. At the bottom of the menu there will be a link to disable mobile view and it works as expected. This exact same thing doesn't work in WebView. It simply turns the menu off and that is all, mobil CSS still stays intact.
I need to make users disable deviantART's mobile CSS, so I need the WebView to work like this.
JavaScript and DOMStorage are enabled.
I need the proper code or an workaround, but after hours of searching I didn't find anything that connected to this problem.
Thank you in advance.

If all you want is to turn off the mobile view you can set the user-agent string on the WebView using setUserAgentString (String ua).

Related

Disable Chrome Options Menu - Android

I am trying to do SSO using Chrome Tabs in my Android Application.
Whenever the chrome comes in it also has options menu of chrome - Is there a way to disable this options menu.
Attached is a screenshot
No, currently is not possibile: you can add items but not remove the button.
https://developer.chrome.com/multidevice/android/customtabs
Simply use a WebView instead of CustomTabs - then there is nothing to hide away, to begin with.
In cases like this you should use phonegap instead of use chrome browser as webview read the docs
basically it runs chrome webview on android, and safari webview on IOS but without all chrome/safari options.
Hey there so in my opinion you should use simple Android webview if you don't want your user to access these options.
Just create a new activity/fragment that contains webview and open your website or any url within it.
This might help you from android developer docs.
Also try this example that might be useful.

Open link from webview in chrome for android

I am trying to open a link in chrome from a webview on android. Is it possible to do this with the URI rather than using an intent.
For example doing something like "chrome://www.google.com"
I have been looking around on here and other places on the internet seeing things like googlechrome:// and googlechrome://navigate?url= as well, but I cannot seem to find anything that works.
Thanks in advance!
I was not able to force it to open in chrome, however, I was able to force it open in the android browser by replacing "https" with "browser." I still do not know if it is possible to force it out of the webview and open it with chrome, but this solution works for my purposes.

How to disable or avoid the language translation option on Android webview?

I'd like to embed a webwiew in my app, but I would like to avoid the language translate option that sometimes appears when loading a web.
I've seen that if you are browsing whit Chrome there is a setting option to disable (http://en.kioskea.net/faq/12336-google-chrome-disable-the-translation-of-foreign-language-websites), but I haven't founded that setting in Android web view to disable it by code (http://developer.android.com/reference/android/webkit/WebSettings.html).
May be it is no possible.
Thank you for any help

Phonegap disable x-frame-option in webview

i have a problem that is when i open a site like facebook.com in iframe in my phonegap app don't open because x-frame-option.
my question is can i disable checking x-frame-option from java code of cordova webview ?
or use another webview in the same activity one it top and on at down and change the url of webview ?
i'm not good on phonegap and not good in android please help me :D
Thanks all
I found the great solution in this amazing plugin
https://github.com/Wizcorp/phonegap-plugin-wizViewManager
you can add a webview to android and ios and select it position it's really great.
I would assume it isn't possible to allow it on Cordova because it is up to web view of device to handle. What you probably could do is to first download the HTML for some page with AJAX query, strip the
<meta http-equiv="X-Frame-Options" content="DENY" />
of from there and then inject the whole content into iframe. Of course this only works for single page but if that is SPA (single-page application), it might even be enough.

How to implement a complete HTML page on Android without using WebView

I have a string which consumes the html code of a form and I want to show that form in my app and it should also work further as on submit it should move forward to next page.
I used WebView, it just shows the page in a static way. It don't support buttons and DatePicker, so I DONT WANT WEBVIEW.
First off, WebView does support buttons, and you could support a DatePicker either by using an HTML/JS one or by doing something fancy to route a request to the Java side of things. I really suspect your insistence on not using WebView is going to prove unproductive.
That said, sure you should show your HTML in your app without using WebView... you could write your own web control or take another (Firefox is open source as is WebKit on which WebView is based, in fact so is WebView itself for that matter). That's going to be a heck of a lot of work though.

Categories

Resources