FBarrca / obsidian-handwritten-notes

Obsidian Handwritten Notes Plugin
MIT License
177 stars 5 forks source link

Boox Note Air3 C almost works #26

Closed ondrejdyck closed 7 months ago

ondrejdyck commented 7 months ago

I was so excited to stumble across this plugin!

I recently bought a Boox Note Air3 C running Android 12 (see https://shop.boox.com/products/noteair3). It is an e-ink writing tablet intended to simulate writing on paper that doubles as an e-book reader. The preinstalled reader is called Boox Neo Reader that lets you write on pdfs and their note-taking app is called just Notes. Your plugin automatically finds the Neo Reader app and sends it a one page pdf that you can write on (all other writing apps I have tried on this device lag too much to use for writing). Within Neo Reader you get a very nice writing experience but most of the time the created pdf does not display on the Obsidian side after being created. One time I was able to get it to work, although not seamlessly. I'm not sure what I did to get it to work but ended up exiting everything and then the next time I opened Obsidian that one handwritten pdf showed up. I can't replicate it again much as I try.

Also of note, the Notes app does not show up as an option for use with your plugin. This is a tragedy because this is exactly the app you would want to handle all the headaches of adding pages, pens, shapes etc. and provides a very nice handwriting experience.

As far as I am aware Boox is the only e-paper writing device that has the play store and lets you install things like Obsidian. It would be awesome if you could look into the compatibility because it looks like it almost worked right out of the box. It might be worth reaching out to Vojislav Dimitrijevic (Voya) who reviews e-ink devices on YouTube (e.g. https://www.youtube.com/watch?v=8h_EZgusrP4&list=PLsSI9-gaSSmiGIFbiZ4k4Fdrhyu4bAAbP&index=2) and tell him about your project. He seems to have contacts at Boox and gets reviewer devices. It is possible you might be able to get a developer freebie to play with.

Having this plugin work on a device dedicated to taking handwritten notes and integrated with Obsidian would be the next level of note taking!

Keep up the good work!

FBarrca commented 7 months ago

Can you try the suggested apps for android (mainly Xodo) and share your experience? I see Boox devices are very popular.

ondrejdyck commented 7 months ago

I can confirm that the Xodo app does work. As far as the Obsidian handwriting plugin is concerned everything seems to work perfectly. The Xodo app opens, you can write in it, and when closed the pdf shows up in Obsidian with no hiccups.

The Xodo app also works but the main problem is that the displayed markings lag behind the stylus location significantly. When writing at normal speed, the displayed line on the screen can be 1-2 letters behind the current location of the tip. Which, for me, is like hearing your own echo in a phone conversation.

I will keep poking around to see if I can figure out what I did to make it work with the Neo Reader that one time. It is so close to just working.

Additional Thoughts: As I understand it, the plugin creates a pdf in the Obsidian vault and then sends it to a third party pdf annotator. This is why it detects Neo Reader as an available pdf annotator. Ideally, (I think) we would want to use the note-taking app instead of Neo Reader. But this app does not take in pdfs so is not detected as an option. In the settings, one can set the note-taking app to always export the note as a pdf which gets saved in an apparently unchangeable, but accessible, location. I can manually copy a pdf note over to my Obsidian vault and it shows up without a problem.

To get the plugin working with the note-taking app it seems like we would need 1) to detect apps other than pdf readers, 2) let the note-taking app handle the pdf creation, 3) detect when the note is closed and the new pdf is created, 4) copy or move the new pdf into the vault and associate it with the Obsidian note. This would have to be a special case for Boox devices and their note-taking app so it may not be a route you want to go down.

Thoughts?

FBarrca commented 7 months ago

You are correct on how it works. I don't own a boox, can the files from the note-taking app be accessed from the filesystem? And if so, when you edit them, they are changed in place instead of being imported? If so, I Think can add support for them with a couple of lines of code.

ondrejdyck commented 7 months ago

I don't think the files from the note-taking app can be accessed from the file system. Boox is using a proprietary file format for their notes and I can't tell where those are stored...

But, once the auto pdf export option is checked, pdfs start appearing in 'Internal shared storage/note/name_of_note/name_of_note.pdf' whenever that note is closed.

The note-taking app will overwrite the pdf with any updates from the note-taking app side, so far so good. But if I edit the pdf with another app, like the Neo Reader, it also overwrites the pdf and the note-taking app does not see this update. The note-taking app is not actually looking at the pdf but the proprietary file. On closing the note-taking app, it again overwrites the pdf and removes the changes made elsewhere.

This means that if we were to use the note-taking app to create a note, we will not be able to make further edits once it gets converted to pdf unless we use a different app. And then we will end up with data loss if the note is ever opened (and closed) again with the note-taking app. This is just asking for all kinds of trouble.

It sounds like your original solution, create a pdf first and then pass it off to a third party pdf editor, is the way to go.

So, why do edits with Neo Reader not show up in Obsidian consistently like they do with Xodo? I'll poke around a bit more and see if I can figure this out.

FBarrca commented 7 months ago

It is because of how neo reader treats PDFs. Most PDF editing apps in Android do not actually edit the file itself but make a copy and store it in their own sandbox file system, and when you want to get the file back they export it from there. Xodo is one of the exceptions.

ondrejdyck commented 7 months ago

Update:

With your comment in mind, I played around some more creating pdfs with the Obsidian plugin and trying to use the Neo Reader to edit.

There is an option in Neo Reader to 'Embed Data'. I assume this means, take me out of your sandbox and give me my file. And sure enough, tapping this option exports a pdf to the Downloads folder (strangely enough). It has the same name as the pdf created in Obsidian. If we simply move this file from Downloads to the handwritten-notes folder and overwrite the previous pdf, it works.

Following this workflow, we can make multiple edits (both additions of new text and deletions of previously written text) with Neo Reader. (The advantage of Neo Reader on the Boox platform is that there is very little perceptible lag between the position of the stylus and the displayed lines as well as a few cool minor features such as scribble to erase and auto shape detection etc.)

So, I think the only missing piece of the puzzle to get Neo Reader working fairly seamlessly is, if Neo Reader is the selected pdf editor, the Obsidian plugin needs to check the directory '/storage/emulated/0/Download' for a pdf file of the same name it originally created. When this file shows up, move it to the handwritten-notes directory (overwriting the old version in the handwritten-notes directory, and deleting the one in the Download directory).

Note this workflow requires the user to manually tap the 'Embed Data' option each time they make edits to the file, much like a manual 'Save File' of yesteryear. But it is located in an easily accessible drop down menu so I don't think it much of a hurdle if users are simply made aware that nothing shows up on the Obsidian side until the data is embedded.

Thoughts?

ondrejdyck commented 7 months ago

Update 2:

I installed another app called FolderSync and set it up to move any pdf from Download to the handwritten-notes directory and voila! Everything works.

ondrejdyck commented 7 months ago

tldr - the plugin will not work with the Boox Notes app, but it will work with Neo Reader if 1) you tap 'embed data' after you are done taking the note and 2) you move the output pdf from the Download directory to the handwritten-notes directory (I used FolderSync to automate this process, free download from the play store).

looloo06 commented 5 months ago

tldr - the plugin will not work with the Boox Notes app, but it will work with Neo Reader if 1) you tap 'embed data' after you are done taking the note and 2) you move the output pdf from the Download directory to the handwritten-notes directory (I used FolderSync to automate this process, free download from the play store).

Hi @ondrejdyck, I'm trying to use FolderSync to automate the copy from Download to Obsidian handwritten-notes directory, but I can't select the instantaenous synchronisation. What are your synchronisation parameters to get the handwritten notes copied correctly automatically in the handwritten-notes directory? Thanks for your help!

ondrejdyck commented 5 months ago

tldr - the plugin will not work with the Boox Notes app, but it will work with Neo Reader if 1) you tap 'embed data' after you are done taking the note and 2) you move the output pdf from the Download directory to the handwritten-notes directory (I used FolderSync to automate this process, free download from the play store).

Hi @ondrejdyck, I'm trying to use FolderSync to automate the copy from Download to Obsidian handwritten-notes directory, but I can't select the instantaenous synchronisation. What are your synchronisation parameters to get the handwritten notes copied correctly automatically in the handwritten-notes directory? Thanks for your help!

Ah, yes, I had the same issue. You have to first go to the 'Scheduling' tab, set up a sync schedule, and then make sure the 'Scheduled sync enabled' checkbox at the top is checked. Once you have a sync schedule set, then the 'Instant sync' option under the 'Sync options' tab is no longer grayed out.

So, it doesn't really matter what your sync schedule is. I set mine to sync daily at 12pm just to put something down. This just allows the 'Instant sync' check box to be enabled.