如何为Android创建浏览器?

发布于 2024-10-19 11:51:16 字数 1436 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

蘸点软妹酱 2024-10-26 11:51:16

这取决于你所说的开发浏览器是什么意思......

从头开始开发浏览器+渲染引擎是一项艰巨的工作,
但是您可以使用 WebViewClient 轻松创建基于 Android WebView 的浏览器通过改变用户与浏览器交互的方式创造新的用户体验。

Webview 有各种钩子来拦截用户与浏览器的交互,因此您可以轻松扩展它。例如,您可以让用户翻阅页面(如 google fastflip),通过将渲染的网页映射到 OpenGL 空间(如球体浏览器)等来尝试 3D。

作为起点,请查看 Aleksander Kmetec 的博客 和他的 Mosembro 项目,该项目通过添加微格式支持来扩展 Android 浏览器。

It depends on what you mean by develop a browser...

Developing a browser + rendering engine from scratch is a hell lot of work,
but you could easily create a browser based on Androids WebView using a WebViewClient and create a new user experience by changing the way the user interacts with the browser.

The Webview has all kinds of hooks to intercept user interaction with the browser, so you can easily extend it. For example you could let the user flip through pages (like google fastflip), experiment with 3D by mapping the rendered webpage into OpenGL space (like sphere browser) etc.

As a starting point have a look at Aleksander Kmetec's blog and his Mosembro Project, that extends the Android browser by adding microformat support.

动听の歌 2024-10-26 11:51:16

听起来像是一个非常大的项目,因此您不能从头开始并将其写下来。你必须制定一个关于如何实现所有部分的计划,写下类图等。如果你学习信息学,你应该在前几个学期听说过这些事情。

首先你应该问自己这个项目是否可行,从大多数人的评论中可以看出,你不应该低估这个任务!

我真的建议您了解此任务的范围,这里是 Android 浏览器的源代码,让您了解它的复杂性。

Sounds like a really big project and therefore you can't just start from scratch and write it down. You have to make a plan on how you want to implement all parts, write down class diagrams etc. If you study informatics you should have heard of these things in previous semesters.

First you should ask yourself if that project is feasible, as you can see from the comments most people agree that you should not underestimate this task!

I really suggest you to understand the extent of this task, here is the source code of Androids browser to give you an impression of it's complexity.

提笔落墨 2024-10-26 11:51:16

要在 Android 中创建完整的 Web 浏览器,您可以使用 WebView

简单的代码快照:

WebView wv = (WebView)findViewById(R.id.webview1);    
wv = (WebView) findViewById(R.id.webView1);
wv.loadUrl("http://www.apsmind.com");

完整的代码参考请访问:http://androidshivendra.blogspot。在/2013/12/android-browser.html

For creating complete web browser in Android you use WebView.

Simple snap of code:

WebView wv = (WebView)findViewById(R.id.webview1);    
wv = (WebView) findViewById(R.id.webView1);
wv.loadUrl("http://www.apsmind.com");

for complete code reference visit: http://androidshivendra.blogspot.in/2013/12/android-browser.html

迷途知返 2024-10-26 11:51:16

对于有 Android 开发经验的人来说,制作一个非常基本的浏览器可以在一两天内完成,就像其他人所说的那样,WebView 提供了显示网页所需的几乎所有内容。有一些关于 JavaScript 和其他功能的设置需要检查,然后标记一个基本的 url 文本框和一个 go 按钮,这几乎是一个基本的 Web 浏览器完成了。

真正的工作在于所有高级设置。
对于一个人来说,在几个月内制作一款与大公司竞争的浏览器可能有点困难,但制作一款自己的、有效的浏览器是很有可能的。试一试吧!

Making a very basic browser could be done in a day or 2 for someone with experience in Android development as just like others have stated WebView provides pretty much all you need to display a Web page. There are a few settings around JavaScript and other features to check and then after marking a basic text box for the url and a go button that is pretty much a basic Web browser done.

The real work comes in all the advanced settings.
Making a browser that competes with the big guys maybe a little difficult for one person in a couple of months, but making something of your own that works is very possible. Give it a go!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文