1

I'm updating app to android targetSdk = 23 and now working on permission requests. Do I need to get some some of dangerous permission for the snappyDB library (it uses kryo library inside)? I mean exactly this permissions:

READ_EXTERNAL_STORAGE
WRITE_EXTERNAL_STORAGE

Thank you!

Kirill Vashilo
  • 1,559
  • 1
  • 18
  • 27

1 Answers1

2

The permission requirements depend on your implementation. By default SnappyDB uses the internal storage provided from the context. If you need to write to the external storage, you will need those permissions.

Check the DBFactory.java class in the source code. https://github.com/nhachicha/SnappyDB/blob/master/library%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsnappydb%2FDBFactory.java

No permissions call

public static DB open(Context ctx, Kryo... kryo) throws SnappydbException {
    return open(ctx, DEFAULT_DBNAME, kryo);
}

Require Permission - if you write to an external folder

public static DB open(String folder, String dbName, Kryo... kryo) throws SnappydbException {
    String dbFilePath = folder + File.separator + dbName;
    return new DBImpl(dbFilePath, kryo);
}
Sonny
  • 186
  • 1
  • 10
  • 1
    You are absolutely right; found the info about the internal storage in docs: https://github.com/nhachicha/SnappyDB#create-database – Kirill Vashilo Mar 07 '16 at 20:09