From 7d0109e6739c466eab61d56b9c5445dd7cfe137e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Sun, 29 Jan 2017 13:54:34 +0100 Subject: [PATCH] Clarified usage steps in README Previously there was no mention of the generated classes and their location. Also, declaring the content provider in the manifest was missing. --- README.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 95000e1..6c100c7 100644 --- a/README.md +++ b/README.md @@ -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; @@ -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"; @@ -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 + +``` + Table column annotations ------------------------