Content Provider

当需要将数据共享给其他应用时,需要使用ContentProvider,否则直接使用SQLiteDatabse即可。

Content Provider 是从一个进程中访问另一个进程数据的标准接口。

URI

content:///

[/id]

  • content://user_dictionary/words
  • content://user_dictionary/words/1

MIME Type (Future)

重要类

  • UriMatcher
    • addURI(String authority, String path, int code)
    • int match(Uri uri)
  • ContentUris
    • static Uri withAppendedId(Uri contentUri, long id)
    • static long parseId(Uri contentUri)
  • ContentValues
    • getAsXXX 系列方法
    • put 系列方法
  • ContentResolver

results matching ""

    No results matching ""