It requires minimal configuration.
All you need to do is, specify SugarApp as your application class in AndroidManifest.xml. You do that by changing the
android:name attribute of the
The meta-data tags are all optional and serve the following purpose:
|Name of the generated sqlite database file. eg: app_name.db
|Version of your database schema.
|Logs the generated Select queries.
|Specify a package name where your domain/entity classes are present. This helps in smoother table creation.
SugarRecord for all the classes that you need persisted. That's it. Sugar takes care of table creation for you.
Note: Please retain the default constructor.
Or you can use annotations
@Table, but then you should define a
private Long id field
Performing CRUD operations are very simple. Functions like
findById(..) are provided to make the work easy.
Note: Record indexes start at index 1.