如何在 Android 应用程序中为网页添加书签?

发布于 2024-12-21 14:41:18 字数 109 浏览 2 评论 0原文

我正在开发一个类似报纸的应用程序。我想知道如何通过单击按钮保存网页并在稍后的时间点显示它。

我用谷歌搜索这个是徒劳的。如果有人知道如何做到这一点并且可以提供一些有用的链接,我们将不胜感激。

I am developing a Newspaper like application. I'm wondering how to save webpages with the click of a button and display it at a later point in time.

I googled for this in vain. If anyone knows how to do this and can provide some useful links, it would be greatly appreciated.

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

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

发布评论

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

评论(1

巾帼英雄 2024-12-28 14:41:18

也许您可以将网址与图标一起保存在数据库中,或者尝试从网站获取屏幕截图以用作图标?

您可能可以将 Webview 转换为 Drawable/Bitmap 而不会出现太多问题。

这里有两个适用于 Android 的数据库/sql 教程:

http://www.screaming-penguin.com/node/ 7742

http://developer.android.com/resources/tutorials/notepad/index.html

网站的 Favicon:http://developer.android.com/reference/android/webkit/WebView.html#getFavicon()

从评论中编辑:
这是 Android 团队的官方数据库教程。 http://developer.android.com/resources/tutorials/notepad/index.html

它创建一个记事本应用程序,使用数据库来保存笔记。您可以将其用作新闻应用程序的基础,您可以存储 URL、标题和有关书签的任何其他信息,而不是在数据库中存储注释。

将信息保存到数据库后,如果您愿意,可以在 Web 视图(如果您使用的是 Webvire)中使用 getFavicon() 方法来获取书签的图标。
http://developer.android.com/reference/android/webkit/WebView .html#getFavicon()

Perhaps you can just save the url in a database together with the favicon or try to get a screenshot from the site to use as icon?

You could probably convert the Webview to a Drawable/Bitmap without too much problems.

Here's two database/sql tutorials for Android:

http://www.screaming-penguin.com/node/7742

http://developer.android.com/resources/tutorials/notepad/index.html

Favicon for a site: http://developer.android.com/reference/android/webkit/WebView.html#getFavicon()

EDIT from comment:
Here is an official database tutorial from the Android team. http://developer.android.com/resources/tutorials/notepad/index.html

It creates a notepad app what uses a database to save notes. You can use it as a base for your news app and instead of storing notes in the database you can store URL, Title and any other information about the bookmark.

After you have saved the information to the database you can use the getFavicon() method in the Webview (if a webvire is what you are using) to get an icon for the bookmark if you wish one.
http://developer.android.com/reference/android/webkit/WebView.html#getFavicon()

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