I am new to Android development, but I am having problems wrapping Content Providers and, in particular, what are the benefits (if any) for creating a single-window SQLite data source. I can see that if I want to use a synchronization adapter, I need a content provider, but frankly, the Sync API is so impressive that I don't think there is an advantage to rolling my own remote synchronization process using REST.
I also see that by implementing the Content Provider over my SQLite DB, I get a guaranteed Android-driven singleton, but I use AndroidAnnotations, which can manage singleton for me, and it doesn’t seem like I read that it’s even recommended to have DB helper for singleton if I manage my open connections properly.
Am I missing something? The Content Provider API looks unexpectedly low-level and error prone for a single DB application. In particular, managing the URI mappings “manually” and introducing this strange layer of abstraction does not seem to bring much significance.
So is there a value in Content Providers for local SQLite databases? And if so, is there some kind of infrastructure that will generate my URI mappings for me, or does it strictly collapse your own?
source
share