Back to project page sqlite-provider.
The source code is released under:
Apache License
If you think the Android project sqlite-provider listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.novoda.sqliteprovider.demo.persistance; //from w ww . j av a 2 s .co m import android.content.ContentResolver; import android.content.ContentValues; import android.net.Uri; import com.novoda.sqliteprovider.demo.provider.FireworkProvider; public class DatabaseWriter { private final ContentResolver contentResolver; public DatabaseWriter(ContentResolver contentResolver) { this.contentResolver = contentResolver; } public void saveDataToFireworksTable(ContentValues values) { saveDataToTable(DatabaseConstants.TBL_FIREWORKS, values); } private void saveDataToTable(String table, ContentValues values) { Uri uri = createUri(table); contentResolver.insert(uri, values); } private Uri createUri(String tableName) { return Uri.parse(FireworkProvider.AUTHORITY + tableName); } }