opkitalia.blogg.se

Sqlite kotlin
Sqlite kotlin









sqlite kotlin

finally isfavourite filed is Integer type which is going to save data in 0 or 1 type, indicating not favourite and favourite respectively. Second quote text filed will be used to add text of the actual quote which is text formate and author, source and creationdate fields are also of type text. Here are some points that is notable, first is that we created auto incremental id filed which could not be null.

sqlite kotlin

according to the above mentioned functional requirements, schema could be as per following image Schema for Quote table Next thing that we need to be very sure of, is the database schema.

sqlite kotlin

Implementation ":anko-sqlite:0.10.5" Code language: JavaScript ( javascript ) DB Schema Implementation ":anko-commons:0.10.5" // Anko SQLite Let’s open Android Studio and create a new project with Kotlin Support. Because here, our core requirement is to understand Anko-SQLite wrapper library and to use SQLite in efficient way in kotlin. But we will make this as simple as possible.

  • User could also save the source of quote or author nameĪccording to our above mentioned requirements there could be number of ways to implement this thing.
  • User will be able to delete any quote from the save list.
  • In home screen all of quotes will be displayed.
  • User will be able to find its stared quotes as a list.
  • User will be able to star any quote he/she wants to.
  • This application will allow users to save its quotes.
  • For this we are using SQLite database that will be helpful for us to save quotes and latter on retrieve it.įirst of all let’s discuss some of core Functional requirements of the applicaton

    sqlite kotlin

    In this post we are going to implement an Application which could be used to save favourite quotes. Which provides very easy and complete way of using this library. } Code language: JavaScript ( javascript )įor further reading and using this sqlite wrapper can check its official documentation.











    Sqlite kotlin