I do not think, you can compare with an ORM with Content Provider. ORMLite offers following features link to user and has complete separate goal when developed.
But beside the things you mention, their are couple of other benefits of content provider.
if you want to share date between multiple application or process. May be right now you do not have any plan to do so, but seems like you app is heavy on database, and in future if you plan to share your data with third party or your another app you have an option with content provider.
Content provider is standard throughout all release of Android, that also means that your app is safe with that. I am pretty sure ORMLite is stable too. But do you really wanna take that risk, specially if that not saving your time or you do not have any business requirement to do so. Android API is already fragmented do you want to take another work load on top of that?
if you wanna upload data to cloud it is easy to integrate with SyncAdapter
Use android security and permission feature.
You are right about the extra code needed to process Content Provider.
Right now i am working on a project we have around 20 tables. I have created a DAO for every tables. Which basically internally uses Content provider.
DAO->Content Provider->SQL Lite Open Helper
Class XyzDao{
private final Context mContext;
XyzDao(Context context){
this.mContext=context;
}
public String getMyData(){
//content provider code
return myData;
}
public void setMyData(String x, int y, double z){
//content provider code to set the data
}
}
I could have done without Content Provider and right now with current requirement that would worked fine but still i choose this route. You will ask probably why?
- Asynchronous Operation
- Easy Integration with the platform/cloud.
- Less code less bug so less drama (think if i have to implement those tasks we just discussed)
And, the best part is from any Activity i can simply use my DAO to access database.
Alternatively you can directly access SQLLiteOpenHelper from your DAO.
At the end of the day every choice depend on your business requirement. If you have lots of persistence objects ORMLite could be a good choice.