A key-value database for Android

Related tags

Database SnappyDB
Overview

SnappyDB

SnappyDB is a key-value database for Android it's an alternative for SQLite if you want to use a NoSQL approach.

It allows you to store and get primitive types, but also a Serializable object or array in a type-safe way.

SnappyDB can outperform SQLite in read/write operations. benchmark

SnappyDB is based on leveldb and use snappy compression algorithm, on redundant content you could achieve a good compression ratio

Check out the Demo App PlayStore

Usage

try {
   DB snappydb = DBFactory.open(context); //create or open an existing database using the default name
   
   snappydb.put("name", "Jack Reacher"); 
   snappydb.putInt("age", 42);  
   snappydb.putBoolean("single", true);
   snappydb.put("books", new String[]{"One Shot", "Tripwire", "61 Hours"}); 
   
   String 	 name   =  snappydb.get("name");
   int 	   age    =  snappydb.getInt("age");
   boolean  single =  snappydb.getBoolean("single");
   String[] books  =  snappydb.getArray("books", String.class);// get array of string
   	
   snappydb.close();
   
   } catch (SnappydbException e) {
   }

For more recipes please take a look at the Cookbook.

With SnappyDB you could seamlessly store and retrieve your object/array, it uses Kryo serialization which is faster than the regular Java serialization.

Installation

SnappyDB uses native code for performance, it's available as an Android Library Project AAR.

dependencies {
    compile 'com.snappydb:snappydb-lib:0.5.2'
    compile 'com.esotericsoftware.kryo:kryo:2.24.0'
}

or

Manual:

  • Download JAR file and other folders from here
  • Put all the files and folders in the libs subfolder of your Android project
libs
├───|── snappydb-0.5.2.jar
    |── armeabi
    │   └── libsnappydb-native.so
    ├── armeabi-v7a
    │   └── libsnappydb-native.so
    ├── mips
    │   └── libsnappydb-native.so
    └── x86
        └── libsnappydb-native.so

Cookbook

Common tasks snippets

Create database

Create using the default name
 DB snappydb = DBFactory.open(context);
Create with a given name
 DB snappydb = DBFactory.open(context, "books");

SnappyDB use the internal storage to create your database. It creates a directory containing all the necessary files Ex: /data/data/com.snappydb/files/mydatabse

Using the builder pattern
 DB snappyDB = new SnappyDB.Builder(context)
                    .directory(Environment.getExternalStorageDirectory().getAbsolutePath()) //optional
                    .name("books")//optional
                    .build();

directory Specify the location of the database (sdcard in this example)

Close database

snappydb.close();

Destroy database

snappydb.destroy();

Insert primitive types

snappyDB.put("quote", "bazinga!");

snappyDB.putShort("myshort", (short)32768);

snappyDB.putInt("max_int", Integer.MAX_VALUE);

snappyDB.putLong("max_long", Long.MAX_VALUE);

snappyDB.putDouble("max_double", Double.MAX_VALUE);

snappyDB.putFloat("myfloat", 10.30f);

snappyDB.putBoolean("myboolean", true);

Read primitive types

String quote      = snappyDB.get("quote");

short myshort     = snappyDB.getShort("myshort");

int maxInt        = snappyDB.getInt("max_int");

long maxLong      = snappyDB.getLong("max_long");

double maxDouble  = snappyDB.getDouble("max_double");

float myFloat     = snappyDB.getFloat("myfloat");

boolean myBoolean = snappyDB.getBoolean("myboolean");

Insert Serializable

AtomicInteger objAtomicInt = new AtomicInteger (42);
snappyDB.put("atomic integer", objAtomicInt);

Insert Object

MyPojo pojo = new MyPojo ();
snappyDB.put("my_pojo", pojo);

Note: MyPojo doesn't have to implement Serializable interface

Read Serializable

 AtomicInteger myObject = snappyDB.get("atomic integer", AtomicInteger.class);

Read Object

MyPojo myObject = snappyDB.getObject("non_serializable", MyPojo.class);

Note: MyPojo doesn't have to implement Serializable interface

Insert Array

Number[] array = {new AtomicInteger (42), new BigDecimal("10E8"), Double.valueOf(Math.PI)};

snappyDB.put("array", array);

Read Array

Number [] numbers = snappyDB.getObjectArray("array", Number.class);

Check Key

boolean isKeyExist = snappyDB.exists("key");

Delete Key

snappyDB.del("key");

Keys Search

By Prefix
snappyDB.put("android:03", "Cupcake"); // adding 0 to maintain lexicographical order
snappyDB.put("android:04", "Donut");
snappyDB.put("android:05", "Eclair");
snappyDB.put("android:08", "Froyo");
snappyDB.put("android:09", "Gingerbread");
snappyDB.put("android:11", "Honeycomb");
snappyDB.put("android:14", "Ice Cream Sandwich");
snappyDB.put("android:16", "Jelly Bean");
snappyDB.put("android:19", "KitKat");

String [] keys = snappyDB.findKeys("android");
assert keys.length == 9;

keys = snappyDB.findKeys("android:0");
assert keys.length == 5;

assert snappyDB.get(keys[0]).equals("Cupcake");
assert snappyDB.get(keys[1]).equals("Donut");
assert snappyDB.get(keys[2]).equals("Eclair");
assert snappyDB.get(keys[3]).equals("Froyo");
assert snappyDB.get(keys[4]).equals("Gingerbread");

keys = snappyDB.findKeys("android:1");
assert keys.length == 4;

assert snappyDB.get(keys[0]).equals("Honeycomb");
assert snappyDB.get(keys[1]).equals("Ice Cream Sandwich");
assert snappyDB.get(keys[2]).equals("Jelly Bean");
assert snappyDB.get(keys[3]).equals("KitKat");
By Range [from .. to]
  • both 'FROM' & 'TO' keys exist
keys = snappyDB.findKeysBetween("android:08", "android:11");
assertEquals(3, keys.length);
assertEquals("android:08", keys[0]);
assertEquals("android:09", keys[1]);
assertEquals("android:11", keys[2]);
  • 'FROM' key exist, but not the `TO
keys = snappyDB.findKeysBetween("android:05", "android:10");
assertEquals(3, keys.length);
assertEquals("android:05", keys[0]);
assertEquals("android:08", keys[1]);
assertEquals("android:09", keys[2]);
  • 'FROM' key doesn't exist but the 'TO' key do
keys = snappyDB.findKeysBetween("android:07", "android:09");
assertEquals(2, keys.length);
assertEquals("android:08", keys[0]);
assertEquals("android:09", keys[1]);
  • both 'FROM' & 'TO' keys doesn't exist
keys = snappyDB.findKeysBetween("android:13", "android:99");
assertEquals(3, keys.length);
assertEquals("android:14", keys[0]);
assertEquals("android:16", keys[1]);
assertEquals("android:19", keys[2]);
With offset and limit
//return all keys starting with "android" after the first 5
keys = snappyDB.findKeys("android", 5);
assertEquals(4, keys.length);
assertEquals("android:11", keys[0]);
assertEquals("android:14", keys[1]);
assertEquals("android:16", keys[2]);
assertEquals("android:19", keys[3]);

//return 3 first keys starting with "android"
keys = snappyDB.findKeys("android", 0, 3);
assertEquals(3, keys.length);
assertEquals("android:03", keys[0]);
assertEquals("android:04", keys[1]);
assertEquals("android:05", keys[2]);

//return the fourth key starting with "android" (offset 3, limit 1)
keys = snappyDB.findKeys("android", 3, 1);
assertEquals(1, keys.length);
assertEquals("android:08", keys[0]);

//return the two first keys between android:14 and android:99
keys = snappyDB.findKeysBetween("android:14", "android:99", 0, 2);
assertEquals(2, keys.length);
assertEquals("android:14", keys[0]);
assertEquals("android:16", keys[1]);

//return the third key (offset 2, limit 1) after android:10 before android:99
keys = snappyDB.findKeysBetween("android:10", "android:99", 2, 1);
assertEquals(1, keys.length);
assertEquals("android:16", keys[0]);

Keys Count

Counting is quicker than extracting values (if you don't need them). Especially on very big collections.

By Prefix
assertEquals(9, snappyDB.countKeys("android"));
assertEquals(5, snappyDB.countKeys("android:0"));
By Range [from .. to]
assertEquals(3, snappyDB.countKeysBetween("android:08", "android:11"));
assertEquals(3, snappyDB.countKeysBetween("android:13", "android:99"));

Iterators

Each time you use the offset & limit arguments, the engine makes the query and then scrolls to your offset. Which means that the bigger the offset is, the longer the query will take. This is not a problem on small collections, but on very large collections, it is.

An iterator keeps it's position in the key collection and can be asked for the next key at any time. It is therefore better to use an iterator on very large collections.

Iterators work on DB snapshot, which means that if you add or delete value in / from the DB, the iterators will not see those changes.

Please note that iterators given by the SnappyDB are closeable and need to be closed once finished with. As iterators work on a DB snapshot, not closing them is a serious memory leak.

// An iterator to all keys
it = snappyDB.allKeysIterator();
/*...*/
it.close();

// An iterator to all keys in reverse order
it = snappyDB.allKeysReverseIterator();
/*...*/
it.close();

// An iterator to all keys including and after android:14
it = snappyDB.findKeysIterator("android:14");
/*...*/
it.close();

// An iterator to all keys from android:05 to android:10
it = snappyDB.findKeysBetweenIterator("android:05", "android:10");
/*...*/
it.close();

// An iterator to all keys from android:09 to android:05 in reverse order
it = snappyDB.findKeysBetweenReverseIterator("android:09", "android:05");
/*...*/
it.close();

Here are the methods implemented in KeyIterator :

public boolean hasNext(); // Whether or not this is the last key.
public String[] next(int max); // Get an array of next keys (maximum [max] keys).
void close(); // Closes the iterator.
Iterable<String[]> byBatch(int size); // Get an iterable of key batch, each batch of maximum [size] keys.

Iterators work on key batchs (key arrays) and not directly on keys. You may iterate on all keys with the form:

for (String[] batch : db.findKeysIterator("android").byBatch(BATCH_SIZE)) {
    for (String key : batch) {
        /*...*/
    }
}

Please note that you should use the byBatch iterable to process all keys only on large collections. On reasonably small collections, using the array based APIs (findKeys and findKeysBetween) with the form for (String key : db.findKeys("android")) is a lot more efficient.
Iterators should only be used to process large collections or for collection paging view / access.

License

SnappyDB is opensource, contribution and feedback are welcomed

Copyright 2013 Nabil HACHICHA.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Follow @nabil_hachicha

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-46288191-1', 'github.com'); ga('send', 'pageview'); </script>

Android Arsenal

Comments
  • com.snappydb.SnappydbException: Maybe you tried to retrieve an array using this method ? please use getObjectArray instead java.lang.IndexOutOfBoundsException: Invalid index 104, size is 7

    com.snappydb.SnappydbException: Maybe you tried to retrieve an array using this method ? please use getObjectArray instead java.lang.IndexOutOfBoundsException: Invalid index 104, size is 7

    Im getting this error in random cases, when app crash, i do same steps and works fine sometimes. What can be happenning?

    com.snappydb.SnappydbException: Maybe you tried to retrieve an array using this method ? please use getObjectArray instead java.lang.IndexOutOfBoundsException: Invalid index 104, size is 7 Serialization trace: date (com.firext.android.model.bbdd.DBWork) at com.snappydb.internal.DBImpl.getObject(DBImpl.java:280) at com.firext.android.data.NoSQLWorksPersistenceImpl.getWorkById(NoSQLWorksPersistenceImpl.java:68) at com.firext.android.data.NoSQLWorksPersistenceImpl.getReportInWorkById(NoSQLWorksPersistenceImpl.java:143) at com.firext.android.jobs.GetReplieGroupsForWorkAndReport.onRun(GetReplieGroupsForWorkAndReport.java:31) at com.path.android.jobqueue.BaseJob.safeRun(BaseJob.java:108) at com.path.android.jobqueue.JobHolder.safeRun(JobHolder.java:60) at com.path.android.jobqueue.executor.JobConsumerExecutor$JobConsumer.run(JobConsumerExecutor.java:201) at java.lang.Thread.run(Thread.java:841)

    opened by rfermontero 11
  • Count + limit & offset + iterators

    Count + limit & offset + iterators

    Hi, this pull request adds three features that I need to use SnappyDB in my future app.
    My future app will manage chat objects, potentially tens of thousands of them.

    Count

    Counting is in fact loading data and counting the number of entries. The problem I have with the findKeys("prefix").length is that all keys are loaded into the JVM as managed Strings that I will not use. For small collections, this is not an issue, but for very big collections (as I plan to use SnappyDB for), counting in C++ and not having the JVM manage unused key strings is, I think, important.

    Hence, this request adds countKeys and countKeysBetween.

    Offset & limit

    @tieubao asked it in #21. It allows paging (however, iterators are more suited) and allows to access directly a limited view of the key collection.

    Iterators

    This is the most important feature. It allows to acces data one by one or by batch and to keep a "pointer" to the position inside the collection so that we can continue browsing later. It is very useful for a huge collection because:

    • It allows paging without having to scroll from begining (as offset does).
    • It loads values on demand (better than loading tens of thousands strings into the JVM at once).

    I have documented and tested these three features.
    I have also tried to respect your code style, both in C++ and in Java.

    Let me know what you think ;)

    Salomon

    opened by SalomonBrys 7
  • Consistently crashing on Samsung Galaxy S6

    Consistently crashing on Samsung Galaxy S6

    Looks like the app is crashing somewhere is native code (no stack trace available) - exclusively on Galaxy S6 and Galaxy S6 Edge. Any known cure for that?

    opened by pleasantlight 6
  • Support for List

    Support for List

    Hi,

    This library already looks great, but I have read all the docs you provided but I didn't read anywhere that this library supports any type of List like Array List etc.

    Can you please let me know if it supports?

    Thank you.

    opened by AkshayChordiya 6
  • Cannot resolve the library in gradle

    Cannot resolve the library in gradle

    Failed to resolve: com.snappydb:snappydb-lib:0.5.2-SNAPSHOT

    or

    Failed to resolve: com.snappydb:snappydb-lib:0.5.2

    both variants give the same result.

    opened by magicgoose 5
  • SnappyDB with SQLiteDB

    SnappyDB with SQLiteDB

    First of all I'm very impressed with this library's ease of use and performance. In my app, I'm using another library which is very much required but it uses SQLiteDB internally. Now after integrating this with my present app, which has SnappyDB, I get an error -

    java.lang.UnsatisfiedLinkError: Couldn't load snappydb-native from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.package.name-84.apk,libraryPath=/data/app-lib/com.package.name-84]: findLibrary returned null

    Is there any way I can integrate both snappyDB abd SQLiteDB in my app and make both work.

    opened by DeepakSenapati 5
  • How can I use SnappyDB with Gradle?

    How can I use SnappyDB with Gradle?

    I can add the snappydb-api in the dependencies but unsure how to add the native libraries in the dependencies.

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.snappydb:snappydb-api:0.2.0'
    }
    
    opened by tc 5
  • Support full text search

    Support full text search

    Hi @SalomonBrys, thank you for reading my issue. In case you are working on new pull request, can I ask you a favor for adding full text search to snappydb. It will be great if snappydb has this feature.

    Best regards.

    opened by tieubao 4
  • Allow registration of custom serializers for Kryo

    Allow registration of custom serializers for Kryo

    Kryo is based on several serializers (one per class type). The library provide a bunch of them for common types.

    Currently and for non native type, SnappyDB creates a new instance of Kryo (shouldn't we create a singleton instance the first time we need it ?) and register a serializer according to the given type.

    But, there is no way to add custom serializer in order to handle some external libs (like Jodatime for example). @magro created a project providing some extra serializers, but we can't uses them right now.

    So, it may be great to have a way to configure the Kryo instance. It could be done via a builder method which can be overridden if needed :

    public class DBImpl {
      public void put(String key, Serializable value) ... {
        ..
        Kryo kryo = getKryoInstance();
        kryo.register(value.getClass());
        ...
      }
    
      protected Kryo getKryoInstance() {
        Kryo kryo = new Kryo();
        kryo.setAsmEnabled(true);
      }
      ..
    }
    
    public class MyDBImpl extends DBImpl {
      protected Kryo getKryoInstance() {
        Kryo kryo = super.getKryoInstance();
        kryo.register(DateTime.class, new JodaDateTimeSerializer());
      }
    }
    

    WDYT ?

    enhancement 
    opened by DayS 4
  • On Network call response data stores successfully but not present  while reading.

    On Network call response data stores successfully but not present while reading.

    I am making a network call through volley. On Response success I am trying to store data through SnappyDb which shows that it has stored successfully. But while reading any data is not present. But if I have data outside of response than it saves. Below is my code. I am struggling in this from last 2 days. Your help will be highly appreciated. Thanks

    private void makeApiCall(String key) { if (Utility.isNetworkAvailable(AddCustomerActivity.this)) { final String finalKey = key; showProgressDailog("Adding..."); NetworkEb.getInstance().apiCallAddUser(customerEb, (key != null && !key.contains(":"))? true : false, new OnJsonResponse() { @Override public void onSuccess(JSONObject response) {

                    try {
                        int serverId = response.getInt("id");
                        customerEb.setKey(serverId + "");
                        customerEb.setSync(true);
                        snappyDbUtil.saveObjectFromKey("customer", DbName.CUSTOMER.name(), customerEb);
    

    } catch (JSONException e) { e.printStackTrace(); } }

                @Override
                public void onError(String response) {
                    Utility.showToast("Upload failed! Try Again");
                    progressDialog.dismiss();
    
                }
            });
        } else {
            if (key == null) {
                key = snappyDbUtil.getNewKey(DbName.CUSTOMER.name());
                customerEb.setKey(key);
                customerEb.setSync(false);
                Utility.showToast("Saved locally");
    
            }
            snappyDbUtil.saveObjectFromKey(key, DbName.CUSTOMER.name(), customerEb);
        }
    
    opened by sujeet-kumar-mehta 3
  • NoSuchMethodError exception when trying to open the database

    NoSuchMethodError exception when trying to open the database

    Hi, I'm trying to use snappydb but some problems occurs. my code is:

    public void TrySnappy() throws SnappydbException{
        DB snappydb = DBFactory.open(this.getBaseContext());
    }
    

    but this exception is thrown: java.lang.NoSuchMethodError: com.esotericsoftware.kryo.Kryo.setAsmEnabled at com.snappydb.internal.DBImpl.(DBImpl.java:51) at com.snappydb.DBFactory.open(DBFactory.java:40) at com.snappydb.DBFactory.open(DBFactory.java:65) at com.snappydb.DBFactory.open(DBFactory.java:77) ...... thanks

    opened by chenhx37 3
  • Still maintained?

    Still maintained?

    The last issue that was opened here is from May 2019 and the last commit from November 2019. Have I missed something? Is this repo still being maintained? Is there some thing else/better available right now?

    opened by theScrabi 0
  • UnsatisfiedLinkError

    UnsatisfiedLinkError

    Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.android-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.android-2/lib/arm, /data/app/com.example.android-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libsnappydb-native.so" at java.lang.Runtime.loadLibrary0(Runtime.java:972) at java.lang.System.loadLibrary(System.java:1530) at com.snappydb.internal.DBImpl.(DBImpl.java:40) at com.snappydb.DBFactory.open(DBFactory.java:40) at com.snappydb.DBFactory.open(DBFactory.java:65)

    Getting this error, any solution for this ?

    opened by 09user 0
  • has bad ELF magic

    has bad ELF magic

    Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.example.android-lTDpScKuTNBUWlo7B_e0KA==/lib/arm/libsnappydb-native.so" has bad ELF magic any solution for this ?

    opened by 09user 1
  • 序列化导致oom

    序列化导致oom

    java.lang.OutOfMemoryError: Failed to allocate a 751242068 byte allocation with 8388576 free bytes and 242MB until OOM at com.esotericsoftware.kryo.io.Input.readString(Input.java:464) at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:132) at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:115) at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:641) at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:99) at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:528) at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:657) at com.snappydb.internal.DBImpl.getObject(DBImpl.java:276) at com.***.***.utils.NOsqlUtil.get_userInfoBean(NOsqlUtil.java:87) at com.***.***.activity.SplashFragment.onCreateView(SplashFragment.java:144) at android.support.v4.app.Fragment.performCreateView(Fragment.java:2087) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1113) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1295) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1682) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:541) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5418) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1037) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832) 以上是oom 日志 下面附get_userInfoBean方法

    public static UserInfoBean get_userInfoBean() { DB snappydb; UserInfoBean myObject = null; try { snappydb = DBFactory.open(Utilities.getApplicationContext()); if (snappydb.exists("userInfoBean" + SPUtils.get**Id(Utilities.getApplicationContext()))) { myObject = snappydb.getObject("userInfoBean" + SPUtils.getUserId(Utilities.getApplicationContext()), UserInfoBean.class); // myObject = snappydb.getObjectArray("userInfoBean" + GlobalParams.uid, UserInfoBean.class); } } catch (SnappydbException e) { e.printStackTrace();

        }finally{
         }
        return myObject == null ? new UserInfoBean() : myObject;
    }
    
    opened by dreamofxw 1
  • Save data in same list.

    Save data in same list.

    Hello, I just started using SnappyDB, Found it very useful to store and read data. Just having one issue. I am saving my List via this solution you mentioned in ISSUE#33. I am successfully saving the new data. While when I kill the app and restart it again and get the size of the list it returns me the exact size I saved before killing the app. Now the issue is How to add new object in this list? When I put object in list it returns me new Size.

    opened by zeeshansardar61 0
Releases(0.1.0_arm)
Owner
Nabil Hachicha
Nabil Hachicha
An Android helper class to manage database creation and version management using an application's raw asset files

THIS PROJECT IS NO LONGER MAINTAINED Android SQLiteAssetHelper An Android helper class to manage database creation and version management using an app

Jeff Gilfelt 2.2k Jan 7, 2023
Insanely easy way to work with Android Database.

Sugar ORM Insanely easy way to work with Android databases. Official documentation can be found here - Check some examples below. The example applicat

null 2.6k Dec 16, 2022
Android Database Performance Benchmarks

ℹ Check out our new performance test app that includes ObjectBox. Android Database Performance Benchmark This project evaluates Android databases and

Markus Junginger 80 Nov 25, 2022
Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS.

Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS. It is suited for client or mobile applications.

null 277 Dec 3, 2022
Test any type of cloud database on Android apps. No need of a dedicated backend.

Test any type of cloud database on Android apps. No need of a dedicated backend.

Arjun 9 May 9, 2022
Android with Real-time Database

Android with Real-time Database It was too much effort to build my own real-time database, but the result really satisfying, so it was worth it. Note

null 4 Jun 14, 2022
Realm is a mobile database: a replacement for SQLite & ORMs

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Java version of Realm

Realm 11.4k Jan 9, 2023
ObjectBox is a superfast lightweight database for objects

ObjectBox Java (Kotlin, Android) ObjectBox is a superfast object-oriented database with strong relation support. ObjectBox is embedded into your Andro

ObjectBox 4.1k Dec 30, 2022
A helper library to help using Room with existing pre-populated database [].

Room now supports using a pre-packaged database out of the box, since version 2.2.0 https://developer.android.com/jetpack/androidx/releases/room#2.2.0

Ibrahim Eid 136 Nov 29, 2022
A library for reading Shared Preferences and Database values within the application.

AppDataReader A library for reading and writing Shared Preferences and Database values of the application within the device. Advantages of using this

Anshul Jain 124 Nov 25, 2022
A quick and easy database manager plugin library for your DBFlow databases.

DBFlowManager A quick and easy database manager and viewer plugin library for your DBFlow databases to view, insert, delete, update the tables directl

Wajahat Karim 26 Oct 21, 2022
Android library for viewing and sharing in app databases.

DbInspector DbInspector provides a simple way to view the contents of the in-app database for debugging purposes. There is no need to pull the databas

Infinum 925 Dec 17, 2022
A small library to help with Realm.IO integration in Android apps

Android Realm Asset Helper A small library of methods to help with Realm.IO integration in Android apps Copies a realm database from a the assets fold

Quality Mobile Puzzle Apps 29 Dec 28, 2021
A wrapper around Android's SQLiteDatabase with restoring capability

Restorable SQLiteDatabase RestorableSQLiteDatabase is a wrapper to replicate android's SQLiteDatabase class with restoring capability. This wrapper ma

Navid 21 Oct 21, 2022
an android library for debugging what we care about directly in app.

EN | 中文 Pandora is a tool box that allows you to inspect and modify what includes networks, databases, UIs, etc. directly in your application. It is s

linjiang 1.5k Dec 30, 2022
Core Data for Android

NexusData Core Data for Android NexusData is an object graph and persistence framework for Android. It allows for organizing and managing relational d

Dia Kharrat 71 Nov 11, 2022
🧬 Android DataBinding kit for notifying data changes from Model layers to UI layers on MVVM architecture.

?? Android DataBinding kit for notifying data changes from Model layers to UI layers on MVVM architecture.

Jaewoong Eum 276 Jan 5, 2023
Pref-DB - Android SharedPreferences alternative library

Pref-DB Android SharedPreferences alternative library.

M.Fakhri 5 Sep 14, 2022
Reactor is key value database and is a great alternative to Shared Preferences.

Reactor Reactor is a fast and secure key-value library for Android, and has an embedded database based on the JSON structure and is a great alternativ

mr amir abbas 37 Oct 30, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022