Open link from webview in chrome for android - 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.

Related

Is there any way to load site inside webview without Internet Connection?

I'm currently working on flutter_webview_plugin and I'm opening up my company website inside the webview, The thing is website shows error if suddenly someone turns off the internet (I know This is how it suppose to work) But is there any way I can save the whole website in the storage so it works without the Internet (I know this is kind of ridiculous)?
It will be great if you can answer this with flutter_webview_plugin perspective.
Thanks
You can try this:
Uri.dataFromString('<html><body>hello world</body></html>', mimeType: 'text/html').toString()

How can android app (Intent.ACTION_VIEW) opens url in browser, with named window

How can I, in Android APP, open a URL in browser with a named window?
There are many good solutions for, from Android APP, opening a URL in a browser window with the Intent.ACTION_VIEW, but is there a way to specify a target name?
The reason I need this is because there is a specific step that needs to done is a browser, instead of in my APP. If a new browser window is opened every time, there will be multiple browser windows open. What I need is just using one fixed browser window.
To make it clear, below are two similar situations when open another browser window with a link. What I need is the latter one.
< href="url" target='_blank'> Pop open a new window each time clicked.</>;
< href="url" target='MyWindow'> always open in the same window</>;
Thanks.
The behaviour you're trying to achieve is only possible through a custom webview or a 3rd party library. I would recommend Chrome Custom Tabs though because many mobile browsers actually do implement those and they offer much flexibility. Also some websites block features when they're shown in webview. For example you cannot use Google login in a Webview. You need to launch a browser or a custom chrome tab.

Android WebChromeClient with nanvigation

I am trying to create an app that has a Webview to view a site (with full navigation). The problem is the site requires Chrome. I tried setting the user-agent but that did not work.
In order to get around this I used
webview.setWebChromeClient(new WebChromeClient(){});
This was able to bypass the sites browser check.
The problem I have now is I cannot seem to navigate the site without it opening the default browser app.
I tried using the WebChromeClients onRecievedTitle method but with no success.
Is this even possible? If so, can anyone point me in the right direction?

can I change the URL in a browser previously opened via my application

I have a code in my application to open a browser.
Sometimes I need to tell the browser to load another URL after a few seconds.
Is there a way to make the first browser to change the URL or I need to open a new one always?
Thanks,
Simon
The best way to achieve this would probably be to embed a WebView in your application, and then you can control it directly. Otherwise, as far as I know, you can't control a browser opened up via Intents. I could be wrong about that, but embedding a WebView and controlling it directly seems much more straightforward.
The WebView class reference:
http://developer.android.com/reference/android/webkit/WebView.html
Some notes on the WebView (less pertinent to what you're doing [this article pertains to writing HTML/native hybrid apps], but may have some useful information):
http://developer.android.com/guide/webapps/webview.html

Android webview to work like native browser

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).

Categories

Resources