-
Notifications
You must be signed in to change notification settings - Fork 16
@BindContentProvider
xcesco edited this page Apr 6, 2018
·
2 revisions
Given a data-source definition, this annotation allows generating the associated content provider. Basically, this annotation simply specifies the authority to put into manifest.xml
file.
- authority: define the AUTHORITY for the content provider.
Given an example datasource definition:
@BindContentProvider(authority = "com.abubusoft.contentprovidersample.provider")
@BindDataSourceOptions(updateTasks = { @BindDataSourceUpdateTask(version = 1, task = SampleUpdate02.class) }, populator = SamplePopulator.class)
@BindDataSource(daoSet = { CheeseDao.class }, fileName = "sample.db", version = 1)
public interface SampleDataSource {
}
Kripton generates the data-source implementation and the associated content provider. For the SampleDataSource
, the content provider generated has name BindSampleContentProvider
. Into manifest.xml you need to define the content provider:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.MyApplication">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:name="PersonProvider"
android:authorities="com.example.MyApplication.BindSampleContentProvider"/>
</application>
</manifest>
The generated content provider is generated with Javadoc, feel free to inspect generated source Javadoc to see managed URL and many other features of the generated content provider.
- Introduction
- Goals & Features
- Kotlin
- Immutable or Mutable Pojo
- Annotation Processor Args
- Credits
- Articles
- Benchmarks
- Setup
- Tutorial
- Usage
- Dependencies and inspirations
- Stackoverflow
- Documentation
- SQL logging
- Data source options
- Indices
- SQL Type adapter
- Global SQL Type adapter
- Constraints
- Live data: welcome Architectural components!!
- Paged Live data
- Dynamic parts
- Transactional and batch operations
- Async Transactional and batch operations
- Global transaction
- Support for immutable POJO
- Generate Content provider
- Generate Database schema generation
- Database migration
- BindSqlColumn
- BindContentProvider
- BindContentProviderEntry
- BindContentProviderPath
- BindDao
- BindDaoMany2Many
- BindDataSource
- BindDataSourceOptions
- BindDataSourceUpdateTask
- BindIndex
- BindSqlRelation
- BindSqlAdapter
- BindSqlChildSelect
- BindSqlDelete
- BindSqlDynamicOrderBy
- BindSqlDynamicWhere
- BindSqlDynamicWhereParams
- BindSqlInsert
- BindSqlPageSize
- BindSqlParam
- BindSqlSelect
- BindSqlUpdate
- BindSqlType
- BindSqlTransaction