Currently I'm about to display HTML data into my application with fragment. I'm confused of which one I need to use to get better performance between TextView or WebView. I mean, for rendering speed and memory issue.
Know that Html.fromHtml() is available for TextView to display HTML formatted data but I want to try WebView instead of TextView. But don't know rendering speed and memory issue.
Alternatives to WebView If you want to send users to a mobile site, build a progressive web app (PWA). If you want to display third-party web content, send an intent to installed web browsers. If you want to avoid leaving your app to open the browser, or if you want to customize the browser's UI, use Custom Tabs.
A TextView displays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing.
If you want to deliver a web application (or just a web page) as a part of a client application, you can do it using WebView . The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout.
WebView internally provides different functionality for the display Html data. Also you can use JavaScript in WebView.
While TextView when you are use Html.fromHtml() then its support only few Html tags.
So I think its better to use WebView.
I just mentioned JavaScript functionality but There are other functionality like (Zoom Functionality, Image from web, etc..) All supports in WebView.
depends for what you wish to use it.. if you are loading website and want all the features of that website to be available you should use webview. If you are only displaying one html snippet you should use textview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With