How to bookmark a webpage in an Android application?

二次信任 提交于 2019-12-03 16:35:53

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!