Android SQLite alternatives [closed]
Asked Answered
H

3

8

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.

Herschelherself answered 3/2, 2015 at 14:34 Comment(2)
for Your needs, SQLite DB is the best choice. Because it´easy to implemenent, You don´t need 3rd party libraries and it´s fast, also with much entries. But it´s up to You to decide, look here for alternatives: stackoverflow.com/questions/417917/alternatives-to-sqliteSlothful
"Speed is my main concern" -- for a game, your database or another file structure should be your backing store, but your game operation should be working on POJOs created from the database contents. When you modify the POJOs (e.g., change in an inventory slot), you also kick off a background thread to update the backing store.Ulm
P
7

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.

Parol answered 3/2, 2015 at 14:43 Comment(3)
so, if they are backed by the good'ol sqlite, they shouldn't perform better...Noshow
Realm is NOT backed by sqlite. It is independent database with own API.Pyorrhea
Arh, apologies I thought it was. Thanks for the info.Parol
P
4

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

List of Database for Android Platform

Patrickpatrilateral answered 10/10, 2015 at 11:44 Comment(0)
W
4

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

Wagonette answered 16/10, 2016 at 15:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.