Hi all, I see that this topic came up many times before.
If I understand correctly, the main obstacle is the fact React Native doesn’t support this directly (and, due to it being Android-specific, I doubt it ever will).
I’d be very happy to implement this using a Native Module for Android and was wondering if the Joplin team would be supportive of such an implementation.
Specifically, what I have in mind for the initial implementation is:
-
A simple widget that displays ~5 most recent notes.
-
Clicking on a note opens it in the Joplin app.
The way I’d implement this:
-
Every time a note is open, the main app updates a list of most recently opened notes in JSON inside
SharedPreferences
. Access toSharedPreferences
is achieved using a Native Module. -
The widget itself just displays everything currently in
SharedPreferences
. -
All notes are deep links that open the Joplin app.
My aim is to make the native Android code as trivial as possible, i.e. it would be just a “dumb” view for what’s in SharedPreferences
. This greatly reduces the need to maintain two codebases.
I see that rabeehrz was already looking into implementing deep links so this makes the scope of implementing a widget even easier.
In the future, we can potentially add a few other options:
-
Being able to create a note. I’m not sure if that’s needed, since Joplin already supports app shortcuts on Android (long tap on the app icon brings up a menu).
-
Being able to mark to-do items as done. I’d love this feature, but I’d probably prefer to do this as a separate widget in the future. Most notably, the user would need to specify a notebook and the widget would have to display all to-dos inside of it, so most of the logic of this widget is not reusable.
What’s everyone’s thoughts on this?