andymatuschak / orbit

Experimental spaced repetition platform for exploring ideas in memory augmentation and programmable attention
https://withorbit.com
Other
1.71k stars 54 forks source link

Implement SQLite-based image loader for Android #245

Open andymatuschak opened 3 years ago

andymatuschak commented 3 years ago

We store attachments as BLOBs along with prompts in a flat-file SQLite database (see #243). To display them at runtime, we render an <Image> which points to a special x-orbit-sqlattachment:// URL. We then implement an RCTImageURLLoader (on iOS) to resolve that URL by fetching the BLOB from the database: see ORSQLImageURLLoader.

We need to implement the equivalent image URL loader on Android.

To test:

  1. yarn dev in backend
  2. yarn web in app
  3. yarn dev in web-component
  4. Visit http://localhost:5000, review the prompts in the second review area (which include attachments) by marking them as forgotten (i.e. so that they're due immediately).
  5. yarn android, sign in as test@test.com / testtest. You should see the attachments as expected.