I saw sample C in a presentation by Google IO, and I really want to implement this template. However, I really like the ORMLite library and I want to use this library in my application.
When I say a Google IO presentation, I mean the following: https://www.youtube.com/watch?v=xHXn3Kg2IQE Virgil Dobzanski
Now I have been looking a lot for an implementation that shows me how to use ORMLite in combination with Contentproviders.
Now my problem is that the ORMLite DAO is contrary to the Contentprovider. They essentially do the same and are a pain for integration into each other. ( Using Ormlite in conjunction with the Android content provider, others discuss this and agree with this statement.)
Several libraries have implemented ORMLite in the contentprovider API template, one example: https://github.com/blandware/android-atleap
However, under water, they still return the ContentValues ββmodel (simple types).
Android - using a Dao template using contentProvider This question is similar to my situation, but 3 years ago, and I propose an alternative solution below.
Answer to
@jcwenger is very useful, but I was wondering if something had changed in the last 3 years. I ran into the same problem, and maybe since ORMLite has matured, is it more useful to use ORMLite?
My colleague next to me really, really wants to use ORMLite, since he does not want to write the mapping itself. I am aware of the existence of atleap and Android-OrmLiteContentProvider projects. They only provide an activity cursor, and my colleague wants to have lists of models or one model. Could this be achieved?
My colleague suggests writing my own implementation of Cursor, SyncAdapter? and Contentprovider (needs to be done independently) for working with models. However, can the same functionality be implemented using lists, etc.? Passing events to activity for content servers, etc.
Is it viable?
Edit Most likely, we will use the content content privately. We do not need to expose these content providers. However, the benefits provided by content providers are great. How else can I notify my GUI to update when data changes?
I also need to display data from several tables (joins and other data not contained in one table) in one action and upload images, etc.