如何设置书签在一个Android应用程序中的网页?应用程序、如何设置、书签、网页

2023-09-05 08:17:00 作者:抱走请留言

我正在开发类似应用的报纸。我不知道如何保存网页的一个按钮的点击,并在以后的某个时间显示出来。

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.

我白白用Google搜索了这一点。如果有人知道如何做到这一点,并能提供一些有用的链接,这将大大AP preciated。

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

推荐答案

也许你可以只保存URL的数据库连同图标或试图得到一个截图从网站上为图标使用?

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?

您也许可以在web视图转换为可绘制/位图没有太多的问题。

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

下面是两台数据库/ SQL教程Android的:

Here's two database/sql tutorials for Android:

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

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

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

这是注释编辑: 下面是Android团队的官方数据库教程。 http://developer.android.com/resources/tutorials/notepad/index.html

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.

在你保存的信息,您可以使用getFavicon()方法中的web视图(如果webvire是你正在使用)如果你希望一个获得书签的图标数据库。 的http://developer.android.com/reference/android/webkit/WebView.html#getFavicon()

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()