Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Ormlite in Conjunction with Android's Content Provider

I'm in the process of developing an Android application and I am conflicted about whether or not I should use Ormlite for updating and retrieving data in conjunction with Android Content Provider. The content provider would be used to primarily notify the app of changes in the data that have occurred in the app on other platforms. Perhaps I am making this more complicated than what it needs to be. Some more experienced opinions would be greatly appreciated!

like image 855
dionysus Avatar asked May 04 '12 18:05

dionysus


People also ask

What is the relation between content provider and content resolver in Android applications?

Accessing a provider. When you want to access data in a content provider, you use the ContentResolver object in your application's Context to communicate with the provider as a client. The ContentResolver object communicates with the provider object, an instance of a class that implements ContentProvider .

How many authorities should we provide for a content provider?

At least one authority must be specified. Whether or not the content provider can be instantiated by the system — " true " if it can be, and " false " if not. The default value is " true ".

Which of the following methods is used to initialize a content provider?

onCreate() which is called to initialize the provider.


3 Answers

https://github.com/blandware/android-atleap library is an example of using ContentProvider in conjunction with OrmLite

like image 120
Andrey Grebnev Avatar answered Oct 10 '22 19:10

Andrey Grebnev


Give it a try. Experience gained is usually worth the effort, even if you end up discarding the result. Oh, and let us know how it goes, because I've been curious about OrmLite too. :-)

like image 24
Sparky Avatar answered Oct 10 '22 18:10

Sparky


You can use OrmLiteContentProvider or Android AtLeap accelerator in conjunction with OrmLite. Both libraries allows you to define content provider easily on top of the OrmLite data model.

like image 2
ChrLipp Avatar answered Oct 10 '22 20:10

ChrLipp