Ted

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

1) declare permission

	<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
	<uses-permission android:name="com.android.broswer.permission.WRITE_HISTORY_BOOKMARKS" />
	<uses-permission android:name="android.permission.READ_CONTACTS" />

2) using cursor with specified uri to get data,

public class TestingData extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        Cursor mCur = managedQuery(android.provider.Browser.BOOKMARKS_URI,
        		null, null, null, null
        		);
        mCur.moveToFirst();
        int index = mCur.getColumnIndex(Browser.BookmarkColumns.TITLE);
        while (mCur.isAfterLast() == false) {
        	view.append("n" + mCur.getString(index));
        	mCur.moveToNext();
        }
      
    }
}

 

more info:

http://www.higherpass.com/Android/Tutorials/Accessing-Data-With-Android-Cursors/3/

http://developer.android.com/reference/android/provider/Browser.html

posted on 2012-05-21 20:56  wufawei  阅读(204)  评论(0编辑  收藏  举报