Android SQLite alternatives [closed]

天大地大妈咪最大 提交于 2019-12-19 07:09:08

问题


I'm building a simple android RPG. Each player has access to a maximum of about 50 soldiers. Each soldier has some stats (class, hp, attack, etc), and three inventory slots. There will be only about 100 items in the game to fill these inventory slots. I was hoping to set up a relational database that would have a table for soldiers, a table for items owned, and a few other various tables.

Speed is my main concern. SQLite is the obvious first choice. However, it seems to be very bulky and geared towards databases with 1000's of rows. Is there a better option for small databases? I don't need complex queries or anything, just a way to store data and back it up to a server.


回答1:


There are two nice libs that make data persistance in Android much quicker and simpler to implement as follows;

Cupboard > https://bitbucket.org/littlerobots/cupboard (backed by sqlite)

Realm > http://realm.io/news/realm-for-android/

Realm is the newer one and seems slightly better but both seem to have similar implementations.

Hope this helps.




回答2:


What about Sugar ORM and Firebase?

Sugar ORM is a library that can be used to interact with SQLite database using Object-Relational Mapping. Object-Relational Mapping (ORM) is a technique that used to query and manipulate data from a SQLite database using an object-oriented paradigm. And Sugar ORM takes care of the things like the creation of the database, management of object relationships and provides clear and simple APIs for database operations.

Firebase is a real-time NoSQL cloud-based database. It stores and syncs data with NoSQL cloud-based database in real time. And data is synced across all clients in real-time and remains available when your app goes offline. Data is stored as JSON and developer can browse the data using a web-based console. And it includes offline support as well. It is very easy to integrate Firebase to Android project.

Copied from Alternatives to the SQLite in Android




回答3:


At the moment there are several embeddable databases out there that you can use in a mobile application. Let’s examine the most popular of them and highlight some of their characteristics that have contributed to their widespread use. The next table gives an overview of the type of the data that each one of these databases can store, the license under which it is distributed, and the platforms it supports. Read more here



来源:https://stackoverflow.com/questions/28301452/android-sqlite-alternatives

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!