Exact Difference between “Content-Provider” and “SQLite Database”

后端 未结 9 1676
名媛妹妹
名媛妹妹 2020-12-04 06:59

i have done SQLite database programming for Android, but i dont know anything about Content-Provider except this: \"As i have referred Android Developer page , Android SDK e

9条回答
  •  孤城傲影
    2020-12-04 07:40

    I read this answer while looking for same doubt, so thought of sharing it. it states -

    It's good practice to provide the extra level of abstraction over your data to make it easier to change internally. What if you decide to change the underlying database structure at a later time? If you use a ContentProvider you can contain all the structural changes within it, where as if you don't use one, you are forced to change all areas of the code that are affected by the structural changes. Besides, it's nice to be able to re-use the same standard API for accessing data rather than littering your code with low-level access to the database.

    So, using a content provider would be a good idea.

提交回复
热议问题