pilgr / paper Goto Github PK
View Code? Open in Web Editor NEWPaper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
License: Apache License 2.0
Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
License: Apache License 2.0
Is there a way to retrieve the files saved by Paper? My scenario is that i would like to store the saved files in the cloud to serve as backup.
want to add that i did see a get file something method in one of the classes but it is private.
Since Paper is saving data on local storage, so I want to make sure the data is safe by Paper saved. It's Paper safe?
For the purpose of backup, add Book API for export/import its content.
It would be good to implement some change listener, which would be listening to any change made on storage...
What happens if I rewrite an existing key?
Does it substitute the old data or it appends the new one to the old one?
Very rarely crash happening in AppDialer app using Paper, affects only 0,05% sessions.
Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
Serialization trace:
a (io.paperdb.PaperTable)
at com.esotericsoftware.kryo.io.Input.require(Input.java:199)
at com.esotericsoftware.kryo.io.Input.readVarInt(Input.java:373)
at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:127)
at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:667)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:118)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:557)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:686)
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:204)
at io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:128)
at io.paperdb.Paper.get(Paper.java:52)
at name.pilgr.appdialer.Storage.getHistory(Storage.java:54)
at name.pilgr.appdialer.search.StatsManager.init(StatsManager.java:18)
at name.pilgr.appdialer.Engine.setFire(Engine.java:197)
at name.pilgr.appdialer.Engine.doStartUp(Engine.java:235)
at name.pilgr.appdialer.Engine$1.run(Engine.java:70)
at name.pilgr.appdialer.util.CrashableTask.run(CrashableTask.java:18)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Hello,
Thanks for sharing an interesting library!
What do you think about creating a listener for data changes? I think, it's missing, but quite useful feature. We can invoke methods (or single method) from a potential listener interface in write(...)
and delete(...)
methods. Let me know about your opinion and I can even create a small PR in a free time.
:-)
Regards,
Piotr
I saved a list use Paper.
The size of list about 5000, just a simple bean.
When I read the list from Paper, about spend 15s,
Is it very slow for this case?
The bean like this:
public class Comments implements Serializable {
private static final long serialVersionUID = -1291325341797562204L;
private String Comment;
private boolean flag;
private String user;
private Integer UserID;
private Long TS;
private String id;
}
Originally discovered in #65
Hi guys, is there anybody who can help me with this error?
I suspect it is trapped in recursive calls. any idea how to fix this?
07-14 00:03:44.102 24180-24180/com.application.android.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.application.android.myapplication, PID: 24180
java.lang.StackOverflowError
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
at
My class contains an inner class ,shows below:
public class Question {
public QNCmt entQNCmt;
public String strLastUpdateDate;
public String strDayDiffer;
public String sWebLk;
public int strPraiseNumber;
public int strQuestionId;
public String strQuestionTitle;
public String strQuestionContent;
public String strAnswerTitle;
public String strAnswerContent;
public String strQuestionMarketTime;
public String sEditor;
public class QNCmt {
public String strCnt;
public String strId;
public String strD;
public String pNum;
public String upFg;
}
}
When restoring local data to this class ,it crashes.
Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created (non-static member class): studio.uphie.one.ui.question.Question$QNCmt
Serialization trace:
entQNCmt (studio.uphie.one.ui.question.Question)
mContent (io.paperdb.PaperTable)
at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1267)
at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1075)
at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1084)
at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:570)
at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:68)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:708)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:110)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:708)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:551)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:686)
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:222)
... 29 more
Doesn't paper support classes with inner classes in ?
And, I have a suggestion that paper adds a data-expire function :)
What is the reason for this exception and how to handle this?
#58
Please recheck closed issue
In two of my project I am getting java.exe exited with no zero value when gradle:appDebug after addin Paper dependency. Although I love this project this issue prevents me using this project. I thinks it crosses 65k method limit after using this library.
The use case is quite simple: save a value to the database. The saving process works most of the time, but it's not consistent. I do have permissions for READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE.
I believe this may be a device-specific issue. The device is a Samsung Samsung Galaxy Tab S2 9.7 (SM-T810).
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: io.paperdb.PaperDbException: Couldn't save table: my_table. Backed up table will be used on next read attempt
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at io.paperdb.DbStoragePlainFile.writeTableFile(DbStoragePlainFile.java:229)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at io.paperdb.DbStoragePlainFile.insert(DbStoragePlainFile.java:127)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at io.paperdb.Book.write(Book.java:36)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at com.pacoworks.rxpaper.RxPaperBook$1.call(RxPaperBook.java:155)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at rx.Completable$8.call(Completable.java:487)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at rx.Completable$8.call(Completable.java:481)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at rx.Completable.subscribe(Completable.java:1970)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at rx.Completable$29$1.call(Completable.java:2041)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
05-16 06:37:39.383 31449-31977/com.my.app W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.lang.Thread.run(Thread.java:818)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: Caused by: java.io.FileNotFoundException: /data/data/com.my.app/files/highlights/athlete_highlights.pt: open failed: ENOENT (No such file or directory)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at libcore.io.IoBridge.open(IoBridge.java:456)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at io.paperdb.DbStoragePlainFile.writeTableFile(DbStoragePlainFile.java:209)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at io.paperdb.DbStoragePlainFile.insert(DbStoragePlainFile.java:127)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at io.paperdb.Book.write(Book.java:36)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at com.pacoworks.rxpaper.RxPaperBook$1.call(RxPaperBook.java:155)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable$8.call(Completable.java:487)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable$8.call(Completable.java:481)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable.subscribe(Completable.java:1970)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable$29$1.call(Completable.java:2041)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.lang.Thread.run(Thread.java:818)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at libcore.io.Posix.open(Native Method)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at libcore.io.IoBridge.open(IoBridge.java:442)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at io.paperdb.DbStoragePlainFile.writeTableFile(DbStoragePlainFile.java:209)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at io.paperdb.DbStoragePlainFile.insert(DbStoragePlainFile.java:127)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at io.paperdb.Book.write(Book.java:36)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at com.pacoworks.rxpaper.RxPaperBook$1.call(RxPaperBook.java:155)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable$8.call(Completable.java:487)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable$8.call(Completable.java:481)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable.subscribe(Completable.java:1970)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.Completable$29$1.call(Completable.java:2041)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
05-16 06:37:39.388 31449-31977/com.my.app W/System.err: at java.lang.Thread.run(Thread.java:818)
Currently the internal kryo instance is not exposed (correct behavior), so there is no way to set the kyro log level to debug issues during serialization.
It would be useful for debugging to do Paper.logLevel(DEBUG) which would call to "Kryo.Log.DEBUG()".
how to share the same paper db with two different activites ?
I'm developing a secure App, does Paper use Cryptography by default?
i have two app that using from Paper
;
is possible access to books of app A
from app B
?
thanks
An api for migrating data across different versions would be nice
Warning I get in logcat after every Book.write()
I guess this is actually a Kryo problem?
I updated my Nexus 5X to Android O today and found that some of my stuff doesn't work. I found out that I get a io.paperdb.PaperDbException: Couldn't read/deserialize file /data/user/0/at.schneider_holding.candidate/files/LookmodePersistence/INVOLVED.pt for table INVOLVED
(I have several Books open for different List-Objects)
full stacktrace here: at.schneider_holding.candidate_issue_1651_error_59649C08039B00012897608726AF1FFD_9b898de9661c11e7bc1556847afe9799_7_v2.txt
if i want only one object , i need to read all data into LinkedList,then i find one. Is there any other better way?
The ObjectStream-Issue has me worried, as I'm getting weird bugs that I can't reproduce, that seem to be related to Paper.
I will have to switch to a different solution, if the issue is not resolved
Where can i get the jar file?
A user object saved in Paper was refactored (long ID field was replaced with String ID). Now when trying to read an object from Paper the following exception occurs:
java.lang.OutOfMemoryError
at com.esotericsoftware.kryo.io.Input.readString(Input.java:482)
at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.read(DefaultSerializers.java:195)
at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.read(DefaultSerializers.java:184)
at com.esotericsoftware.kryo.Kryo.readObjectOrNull(Kryo.java:763)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:132)
at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:110)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:708)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:551)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:686)
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:239)
at io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:147)
at io.paperdb.Book.read(Book.java:67)
Hi!
Sometimes I have an exception: Exception java.lang.RuntimeException: Couldn't create Paper dir.
What can I do to avoid this exception?
Hi,
This error started happening frequently in my application, I would like to know if there is anything I can do to prevent it from occurring.
Fatal Exception: java.lang.RuntimeException: Couldn't create Paper dir: /data/data/com.hotmart.sparkle/files/Notification
at io.paperdb.DbStoragePlainFile.createPaperDir(DbStoragePlainFile.java:288)
at io.paperdb.DbStoragePlainFile.assertInit(DbStoragePlainFile.java:278)
at io.paperdb.DbStoragePlainFile.getAllKeys(DbStoragePlainFile.java:160)
at io.paperdb.Book.getAllKeys(Book.java:96)
at br.com.hotmart.hifire.util.storage.impl.BaseStorageAbstract.findAll(BaseStorageAbstract.java:78)
at br.com.hotmart.hifire.util.NotificationUtils.show(NotificationUtils.java:50)
at br.com.hotmart.hifire.v1.gcm.model.NewPostInTrackPayload.takeAction(NewPostInTrackPayload.java:37)
at br.com.hotmart.hifire.v1.gcm.model.GcmMessage.takeAction(GcmMessage.java:105)
at br.com.hotmart.hifire.v1.gcm.GcmListenerServiceImpl.onMessageReceived(GcmListenerServiceImpl.java:62)
at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzn(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzm(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
How to I Open the file programmatically? I want to do that to syn the file via a cloud storage service. So as backup / restore feature.
cannot write and read data when add gms:play-services-gcm in android 4.4.2,
and always error"java.lang.NoClassDefFoundError: io.paperdb.DbStoragePlainFile", how to solve the problem ?
Couldn't read/deserialize file /data/user/0/files/io.paperdb/full_user.pt for table full_user
{
"data": {
"__v": "18",
"_id": "_",
"contact_moods": [],
"contacts": {
"registered_contacts": [
{
"_id": "__",
"checked": false,
"color": 0,
"phone_number": "+__"
},
{
"_id": "__",
"checked": false,
"color": 0,
"phone_number": "+__"
},
{
"_id": "_********",
"checked": false,
"color": 0,
"phone_number": "+*****_"
}
]
},
"country": "EG",
"custom_moods": [
{
"_id": "569f66b9a3479e330e47e28b",
"_mizo": {
"_gif": "/happy.mp4",
"_id": "569e3ecf0bd1d68f5d9e3314",
"_owner": "66609fe0-beb3-11e5-99d0-553ae763ee48",
"checked": false,
"created_at": "2016-01-19T13:49:03.070Z",
"is_preset": false,
"is_published": false,
"liked_by": [],
"reported_by": [],
"tags": [],
"text": "happy",
"textAttr": {
"text_color_index": -16777216,
"text_position_x": 20,
"text_position_y": 20,
"text_size_index": 1
},
"upload_state": "COMPLETED",
"used_by": []
},
"contacts": [],
"groups": [],
"is_enabled": true,
"is_global": false,
"name": "Feeling happy"
},
{
"_id": "569f6ebea3479e330e47e293",
"_mizo": {
"_gif": "/89d4a24f-76f3-41fa-a747-b2a5ff340dd4-1453287075597.jpg",
"_id": "569f67b4a3479e330e47e28f",
"_owner": "66609fe0-beb3-11e5-99d0-553ae763ee48",
"checked": false,
"created_at": "2016-01-20T10:55:48.818Z",
"is_preset": false,
"is_published": false,
"liked_by": [],
"reported_by": [],
"tags": [],
"text": "",
"textAttr": {
"text_color_index": -16777216,
"text_position_x": 0,
"text_position_y": 0,
"text_size_index": 1
},
"upload_state": "COMPLETED",
"used_by": []
},
"contacts": [],
"groups": [],
"is_enabled": true,
"is_global": false,
"name": ""
}
],
"gcm_reg_id": "__",
"groups": [],
"phone_number": "+2__",
"public_mood": {
"_mizo": {
"_gif": "/cold.mp4",
"_id": "569f6ebea3479e330e47e292",
"owner": "66609fe0-beb3-11e5-99d0-553ae763ee48",
"checked": false,
"created_at": "2016-01-20T11:25:46.566Z",
"is_preset": false,
"is_published": false,
"liked_by": [],
"reported_by": [],
"tags": [],
"text": "",
"textAttr": {
"text_color_index": -16777216,
"text_position_x": 0,
"text_position_y": 0,
"text_size_index": 1
},
"upload_state": "COMPLETED",
"used_by": []
},
"is_enabled": true,
"is_global": false,
"name": ""
},
"settings": {
"is_mood_visible_for_contacts_only": false,
"is_sync_on_wifi_only": false,
"language": "EN"
},
},
"isNew": false,
"message": "success"
}
compile 'io.paperdb:paperdb:1.1' dependency is not loading in my Android Studio !!!!
Only that Library project we have to add !!!!?
&
In Demo app nothing was there .... U can try to add few examples, for beginners it will helpful .....
Use consumer proguard to android build tools to automatically merge your proguard rules.
Error:Execution failed for task ':app:processInternalConfigDebugManifest'.
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:36:9-36
is also present at [io.paperdb:paperdb:1.1] AndroidManifest.xml:11:18-44 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:34:5-101:19 to override.
even lint suggestion will not help.
In Android O, individual preferences or even the entire PreferenceManager can call setPreferenceDataStore(), allowing your app to keep the same simple key/value pair API, but provide your own mechanism for storing the underlying data.
The interface is quite simple, it shouldn't take long to write. My time is limited right now, and if yours is too we'll have to wait until either of us is freed :D
https://developer.android.com/reference/android/preference/PreferenceDataStore.html
Hey. I am saving and reading a json in a book.
If I read the json back from the book directly it shows a ClassCastException for String to JSONObject
JSONObject userModelJson = Paper.book(BaseConstants.SESSION_BOOK)
.read(BaseConstants.SESSION_START_USER_MODEL);
but if I read it as a String and then convert it to JSON using JSONObject API, it succeeds.
String userModelString = Paper.book(BaseConstants.SESSION_BOOK)
.read(BaseConstants.SESSION_START_USER_MODEL);
JSONObject userModelJson = new JSONObject(userModelString);
Sample Json
{
"address": [
{
"address": "full address here",
"latitude": "0.0",
"longitude": "0.0"
}
],
"email": "[email protected]",
"name": "Sample",
"phone": "1231231230",
"username": "sampleuser"
}
Every time I try to build my project I get this error: Error:Conflict with dependency 'org.ow2.asm:asm'. Resolved versions for app (5.0.3) and test app (5.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
Here's my dependencies...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.google.dagger:dagger:2.0'
kapt 'com.google.dagger:dagger-compiler:2.0'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'io.paperdb:paperdb:1.5'
testCompile "org.robolectric:robolectric:3.1.1"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "org.hamcrest:hamcrest-core:1.1"
testCompile "org.hamcrest:hamcrest-library:1.1"
testCompile "org.hamcrest:hamcrest-integration:1.1"
// testCompile "org.mockito:mockito-core:2.0.+"
testCompile "org.powermock:powermock-module-junit4:1.6.4"
testCompile "org.powermock:powermock-module-junit4-rule:1.6.4"
testCompile "org.powermock:powermock-api-mockito:1.6.4"
testCompile "org.powermock:powermock-classloading-xstream:1.6.4"
testCompile 'junit:junit:4.12'
}
I get an error when reading an object with a Bitmap field, the error thrown is:
*"You have to add a public no-arg constructor for the class android.graphics.Bitmap"
The StackTrace:
mContent (io.paperdb.PaperTable)
Read more: https://github.com/pilgr/Paper#save
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2936)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2965)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1406)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5371)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: io.paperdb.PaperDbException: You have to add a public no-arg constructor for the class android.graphics.Bitmap
I can't add a constructor to the Bitmap class
Can it encrypt files ? From security point of view it's kind'a important.
If yes then what encryption it uses ?
pls respond.
It will be super easy to use if all the read write calls are in UI thread means background processing done by library itself.
Here's the unobfuscated stack trace. Could you offer any insight into why this might be happening?
Process: com.aashreys.walls.release, PID: 10063
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aashreys.walls.release/com.aashreys.walls.ui.StreamActivity}: io.paperdb.PaperDbException: Couldn't read/deserialize file /data/user/0/com.aashreys.walls.release/files/collections_book/type_unsplash_collection767186.pt for table type_unsplash_collection767186
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: io.paperdb.PaperDbException: Couldn't read/deserialize file /data/user/0/com.aashreys.walls.release/files/collections_book/type_unsplash_collection767186.pt for table type_unsplash_collection767186
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:268)
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:257)
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:235)
at io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:147)
at io.paperdb.Book.read(Book.java:67)
at com.aashreys.walls.persistence.a.b.b(CollectionRepositoryImpl.java:82)
at com.aashreys.walls.ui.q.a(StreamActivityModel.java:67)
at com.aashreys.walls.ui.StreamActivity.j(StreamActivity.java:108)
at com.aashreys.walls.ui.StreamActivity.o(StreamActivity.java:40)
at com.aashreys.walls.ui.d.onCreate(BaseActivity.java:54)
at com.aashreys.walls.ui.StreamActivity.onCreate(StreamActivity.java:61)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: com.esotericsoftware.kryo.KryoException: java.lang.IllegalArgumentException: field com.aashreys.walls.domain.display.collections.UnsplashCollection.id has type com.aashreys.walls.domain.c.b, got com.aashreys.walls.domain.c.a
Serialization trace:
id (com.aashreys.walls.domain.display.collections.UnsplashCollection)
mContent (io.paperdb.PaperTable)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:144)
at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:734)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:712)
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:248)
... 22 more
Caused by: java.lang.IllegalArgumentException: field com.aashreys.walls.domain.display.collections.UnsplashCollection.id has type com.aashreys.walls.domain.c.b, got com.aashreys.walls.domain.c.a
at java.lang.reflect.Field.set(Native Method)
at com.esotericsoftware.kryo.serializers.ObjectField.setField(ObjectField.java:54)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:137)
... 28 more
I'm using Paper 2.0 and facing a rare crash for some users. Here's the log of Crashlytics:
Caused by com.esotericsoftware.kryo.KryoException
com.esotericsoftware.kryo.io.Input.require (Input.java:199)
com.esotericsoftware.kryo.io.Input.readVarInt (Input.java:373)
com.esotericsoftware.kryo.util.DefaultClassResolver.readClass (DefaultClassResolver.java:127)
com.esotericsoftware.kryo.Kryo.readClass (Kryo.java:693)
com.esotericsoftware.kryo.serializers.ObjectField.read (ObjectField.java:118)
com.esotericsoftware.kryo.serializers.FieldSerializer.read (FieldSerializer.java:540)
com.esotericsoftware.kryo.Kryo.readObject (Kryo.java:712)
io.paperdb.DbStoragePlainFile.readTableFile (DbStoragePlainFile.java:248)
io.paperdb.DbStoragePlainFile.readTableFile (DbStoragePlainFile.java:257)
io.paperdb.DbStoragePlainFile.readTableFile (DbStoragePlainFile.java:235)
io.paperdb.DbStoragePlainFile.select (DbStoragePlainFile.java:147)
io.paperdb.Book.read (Book.java:67)
Any help would be really appreciated.
Please add a method which allows selecting a custom location for books? (e.g. on the sdcard)
Paper looks very interesting, but I have some questions about how the file access works. It says random file access is rapid on flash storage. What happens if 2 async tasks read the file and write to the file making the first write to the file obsolete? The second write was based on the result before the first write when it probably should've been based on that after the first write. Does Paper handle these issues or do we have to make sure ourselves that that doesn't happen?
Hi, have you thought about adding RxJava support?
I used pagerdb-1.0.1, it is well except some problems.
Now I want to upgrade to pagerdb-2.0, I find that i can not change paper cache dir to sd card.
Why do you delete the code about interface PaperContextListener?
Hey Pilgr,
Your library is just awesome, we are using it in our many projects.
when we get next version with kryo-4.0.0?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.