backup contacts/bookmark/events with multiple users device

requirement

product need to research backup contacts/bookmark/events function with device can switch multiple users.

two schemes

  1. search developer.android.com with key words: multiple users backup
  2. create demon project and test when switch to different users

progress

  1. searched key words in google and developer.android.com for a half day and failed
  2. get the key code and test for half day.

key code

  • get contacts
    ContentResolver resolver = ctx.getContentResolver();
    Cursor c = resolver.query(ContactsContract.Contacts.CONTENT_URI, null,null, null, null);

  • get Bookmarks

    <span style="font-weight: normal;">ContentResolver resolver = ctx.getContentResolver();
    Cursor cursor = resolver.query(Browser.BOOKMARKS_URI, null, null, null, null);</span>

  • get Events

    <span style="font-weight: normal;">ContentResolver cr = ctx.getContentResolver();
    cur = cr.query(CalendarContract.Events.CONTENT_URI, null, null, null, null);</span>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章