pilgr / Paper

Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
Apache License 2.0
2.34k stars 234 forks source link

[ASK] How to read specific .pt file from custom path folder #142

Closed triarts closed 5 years ago

triarts commented 5 years ago

How to read paperfile.pt that have custom path folder? eq: assets or maybe raw? in my case, I want to export my old data and read it in other application? is there a way to achieve this? Thanks

pilgr commented 5 years ago

Paper has not been designed for such a use case but here is what you can do:

  1. Copy *.pt file from the internal location of one app to the any shared folder (sdcard).
  2. Within another app copy that file from sdcard to the internal folder of the app.

To locate original *.pt file on disk you can use Book. getPath() method.

This method is dangerous because different apps may run on different class signatures (you may change data classes which has been saved in another app). I'd rather use some common formats like json to export/import data.