2013-08-19

Hi Guys!,

Today we are learning about the OrmLite database in android.
OrmLite is the lightweight java ORM supports for android Sqlite Database. The full OrmLite is Object Relational Mapping (ORMLite). and it provide some light weight functionality to store and retrieve java objects. OrmLite avoiding the complexity and more standard  Object Relational Mapping.

ORMLite supports more than one database  using JDBC and also sqlite with native calls to android api. Access Object classes. also provides simple and flexible query using QueryBuilder. Auto generates SQL to create and drop database tables and its have basic supports for database.
OrmLite simpley add Objects of java using annotations and it have powerful abstract Database Object classes also provides simple and flexible query using QueryBuilder. Auto generates SQL to create and drop database tables. And it have basic supports for database transactions.

Object Relational Mapping Lite (ORM Lite) provides some lightweight functionality for persisting Java objects to SQL databases while avoiding the complexity and overhead of more standard ORM packages. It supports a number of SQL databases using JDBC and also supports Sqlite with native calls to Android OS database APIs.

Users that are connecting to SQL databases via JDBC connections will need to download the ormlite-jdbc-4.46.jarand ormlite-core-4.46.jar files. For use with Android applications, you should download the ormlite-android-4.46.jar and ormlite-core-4.46.jar files.

Here is the link to download these jar files OrmLite Jars.
Or more ablout the ORMLite you can visit the ORL Developer site Here.

So In that scenario you need to first create the Pojo class means data model. Lets start the coding.

main.xml

row.xml

Person.java

DatabaseHelper.java

NameAdapter.java

MainActivity.java


You can download the source code OrmLite Database in Android

Show more