Skip to main content

Posts

Showing posts from 2017

ORMLite with Android

This tutorial will guide you how to implement ORMLite (a very light weight, open source, Android compatible ORM) in an Android project. Android supports SQLite database and writing database queries can create a lot of boilerplate code and can be really difficult to debug. I was looking for some sort of ORM library for android. I came around few of them. I decided to give ORMLite a shot. The library is very stable and uses annotations. It was really easy to implement everything so I decided to stick with it. What are the benefits you may achieve compare to conventional way of using SQLite from Android. You will learn to build an app with ORMLite that allows you to store and view data from a database. So lets begin… Model To use ORMLite, you first need to create your model classes. A sample model class would like this. Open below link to view source EmployeeDetails.java Database Helper It is the most important file from the ORMLite implementation point of view, which cons