The cons of using Realm is that it is a third party library, MongoDB is in progress of acquiring Realm, the worst that can happen is that MongoDB shut down development of Realm immediately after acquisition and there will be no support afterwards, which is very unlikely but still a possibility. Realm is open source and in my opinion easier to use than Core Data, and also supports filtering / querying using NSPredicate. realm database file on both Android and iOS app and it will work nicely. The pros of using Realm is that it supports both Android / iOS out of the box, you can use the same. In my opinion, dealing with Core Data and SQLite package can be quite intimidating and time consuming especially if you are just started with iOS development. The cons of using Core Data is that it is an Apple-only technology, if you want to share a same database file across Android and iOS app, there will be additional work required, you can use SQLite as the backing database and use CoreData on top of it, and use the SQLite package on Android to read it. The pros of using Core Data is that it is backed by Apple, means you are guaranteed that it will keep working down the road to iOS 20 and beyond, and there’s no additional size added to your app for using this library. Pros and Cons of using Core Data/ Realm for prepopulated database Using the preset realm file in the actual app.Pros and Cons of using Core Data/ Realm for prepopulated database.I have used the exact same technique to create and embed preset Realm database in my own iOS apps to show train schedule and routes, Komuter and Rapidly. “Why not Core Data? We should use as less third party dependencies as possible!”, I heard you, AppCoda has written a great post on how to use preset SQLite Database with Core Data here, I recommend their tutorial if you plan to stick on Core Data. In this post, we will be using embed Realm database for storing preset static data. The database will only be used for querying or searching, how do we embed a database prepopulated with data into the app when user first install the app? There might be case where your app have a database containing preset static information that won’t be modified, added or deleted by user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |