Select Text in WebView when loading facebook - java

I am loading facebook in my webview in android studio,but I cant select the text of posts or comments,while if I load another website I can do that .Anyone knows how to enable that ?

Selecting Text on mobile version of Facebook doesn't work in Chrome too. Try to disable Javascript in your webview.

Related

Can't login to Facebook using WebView Android

This may seem like a similar question in Stackoverflow but it's not because all the solutions there didn't work.
Facebook announced that they will not be supporting to login to Facebook using native WebView and use their SDK instead. However, my app is a browser app and I can't use their SDK just for this. Yes, I tried using a popup window to log in but it doesn't work for all websites, some websites don't open Facebook login in a popup but instead on the same page.
The weird part about it is that there are many apps on the app store that use WebView and they can log in with no issues while I'm getting this error:
I tried changing the user agent, but it didn't work. I tried using Chrome Custom Tabs but I don't really know to catch the callback when the user has logged in Chrome's tabs then continue in my webview.

How to upload HtmlLink to Android WebView

I'm trying to uplaod html link url to Android Webview.
But I've noticed that it is differ by Android device and OS version.
In Some Device shows the whole texts while the other does not show all the texts.
Is there any way to show whole texts Programmatically.
I'm using Java language and the code is Just
this.loadUrl(strHtml);// this load www.blahblah.com/blah.html
Thank you.

How to enable adding bookmarks in android webview

I am creating a browser app for android and I want know is there any code that helps to enable adding bookmarks in android webview.
This is something you will have to add yourself, a WebView literally just displays html content. It doesn't come with all features like for example Chrome.
To add/save bookmarks you would need to implement a UI for showing the bookmarking button, for entering the URL, for showing a list of previously bookmarked pages etc. Once you have all that you can then get the WebViews current URL by:
webView.getUrl();
and save that to your database.
Then you have the work of displaying a list of saved bookmarks and allowing the users to click them and have the WebView navigate to them.
Here is an example I found (by a simple Google) to help you get started which shows adding a simple bookmarking feature on an WebView: https://www.journaldev.com/15729/android-webview-bookmarks

Is there a way to make webview show flash content?

I am using webview to create an Android app that navigates to my website but some of the content of the website is in flash. Is there anyway to make webview show flash videos?
I have tried adding the line myWebView.getSettings().setMediaPlaybackRequiresUserGesture(true); to my MainActivity.java , and adding android:hardwareAccelerated="true" to my AndroidManifest.xml file.
I was expecting to have my app with webview to play flash videos.
Can't be done. Adobe Flash Player hasn't been supported on Android since version 11.1.

Load url web view android - Java

I have a webview in my app and I got it working like this
webview = (WebView) findViewById(R.id.mainWebView);
webview.loadUrl("https://www.google.com");
But if I try to load the non mobile version of the https://uniondining.sodexomyway.com/Images/MAR2015dutchCalendar_000_tcm1792-59025.pdf it exits out of the app.
How can I load the mobile version of site in my app?
Thanks
Unfortunately, Android does not support viewing PDFs out of the box in a WebView. Luckily, Google has a nifty little tool that allows you to perform this very task quite easily using Google Docs. Basically we will embed our PDF in a Google Doc page on-the-fly and load that.
You can use Google Docs Viewer to read your pdf online:
Here's the code:
WebView webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
String pdf = "http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf";
webview.loadUrl("http://docs.google.com/gview?embedded=true&url=" + pdf);
If you use the view only url the user is not propted to login to there google account.
You're trying to open a link to PDF file. While desktop browsers like Chrome can open it, Android WebView has no builtin PDF reading possibility, so you can't show this inside the WebView. Instead, you can try to download the file and open it with some PDF library like MuPDF.
Also, you need to check if you have permission android.permission.INTERNET set up in your AndroidManifest.xml
Check your URL again. You are trying to loead a pdf which webView can't load but desktop browsers like IE and chrome. But in case of android WebView cant load PDF files.
You can use android pdf library also to create your pdf viewer otherwise you can display it using any pdf viewer installed on your mobile.

Categories

Resources