Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it useful using WebView whole layout in native Android app?

Tags:

I am currently developing a native android app. My app has a lot of activities. I want to develop native android app. But in some case, I want to use a webview where the entire layout is just a webview. Not linear or relative or another layout, just a webview. All of the images and other things running in HTML. All of screen will run in HTML5.

So, I can partially transfer my app into iphone app or other platforms. This is the benefit of this way to me.

But I don't know. Is this way better? What will the performance be? What is the disadvantages of converting to an HTML5 app?

Can you explain?

like image 282
Breed Hansen Avatar asked Feb 22 '13 12:02

Breed Hansen


People also ask

Is it good to use WebView?

Pros of using Web view One page for both android and IOS. I think the main advantage is the ability to make changes without the need for each user to update the app on his device, because all the pages are on your server. No wait for app store approval for updation.

Is Android WebView important?

WebView is powerful because it not only provides the app with an embedded browser, it also allows the developer's app to interact with web pages and other web apps.

What can I use instead of WebView?

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.

Is WebView deprecated in Android?

This interface was deprecated in API level 12. This interface is now obsolete.


1 Answers

There is a very good presentation about this very topic.

  1. Performance: You are adding an additional layer in between, A webkit engine cannot always match native (and sometimes hardware accelerated) rendering performance.

  2. Disadvantages: One is that the API use is limited, you can bind a page's JavaScript to Native code, but not all functionality is available.Though you might want to have a look at capabilities of Cordova project. Another is that emulating complex widgets via JavaScript will slow down the page.

  3. Portability: Indeed is a great advantage, that's why PhoneGap and Cordova are popular. Though many like Facebook App etc have switched to native App for better performance.

The approach you require actually depends on your requirements. This may be my personal rant but IMHO: a markup can be only twisted so far, it can't out-perform industrial grade GUI programming setups as of yet.

like image 53
S.D. Avatar answered Oct 17 '22 07:10

S.D.