Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public interface ListColumns {
Then create a database that uses this column

```java
@Database(version = NotesDatabase.VERSION)
@Database(version = NotesDatabase.VERSION,
packageName = "net.simonvt.schematic.sample.provider")
public final class NotesDatabase {

public static final int VERSION = 1;
Expand All @@ -31,11 +32,12 @@ public final class NotesDatabase {
}
```


And finally define a ContentProvider
Then define a ContentProvider

```java
@ContentProvider(authority = NotesProvider.AUTHORITY, database = NotesDatabase.class)
@ContentProvider(authority = NotesProvider.AUTHORITY,
database = NotesDatabase.class,
packageName="net.simonvt.schematic.sample.provider")
public final class NotesProvider {

public static final String AUTHORITY = "net.simonvt.schematic.sample.NotesProvider";
Expand All @@ -50,6 +52,17 @@ public final class NotesProvider {
}
```

Then build the project to generate classes to a folder defined as `packageName` in annotations (or a `generated` subfolder by default).

Finally define the generated ContentProvider in AndroidManifest.xml.

```xml
<provider
android:authorities="net.simonvt.schematic.sample.NotesProvider"
android:name="net.simonvt.schematic.sample.provider.NotesProvider"
android:exported="false"/>
```

Table column annotations
------------------------

Expand Down