它是有用的使用的WebView整个布局在原生Android应用程序? [英] Is it usefull using WebView whole layout in native Android app?

查看:264
本文介绍了它是有用的使用的WebView整个布局在原生Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个原生的Andr​​oid应用程序。我的应用程序有很多活动。我想开发本地 Android应用程序。但在某些情况下,我想用一个的WebView 其中,整个布局只是一个web视图。不是线性或亲属或其他布局,只是一个web视图。所有的图像和HTML运行其他的东西。 所有画面都将在HTML5中运行。

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.

所以,我可以部分我的应用程序转移到iPhone应用程序或其他平台。这是这种方式的好处给我。

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

不过,我不知道。这是更好的方式?会有什么表现呢?什么是转换为HTML5应用程序的缺点是什么?

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

您可以解释一下吗?

问候

推荐答案

有一个很好presentation 有关这个题目。

  1. 性能:你是在两者之间增加一个额外的层,WebKit引擎不能总是符合本地(有时硬件加速)的渲染性能

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

缺点:其一是该API的使用是有限的,你可以绑定一个页面的JavaScript到本机code,但不是所有的功能available.Though你可能想看看的<一能力HREF =htt​​p://cordova.apache.org/相对=nofollow>科尔多瓦项目。另一种是通过JavaScript模拟复杂的小部件会减慢页面。

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.

可移植性:确实是一个很大的优势,这就是为什么的PhoneGap 和的科尔多瓦很受欢迎。虽然许多像Facebook应用程序等有切换到本地应用程序有更好的表现

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.

您需要实际的方法取决于您的要求。这可能是我个人的言论,但恕我直言:一个标记只能被扭曲,到目前为止,它不能在性能工业级GUI编程设置为的是尚未

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.

这篇关于它是有用的使用的WebView整个布局在原生Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆