-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Organice Android local storage access in android native app #932
Comments
* android tools to 7.3.1 * manifest namespace recommendation
Using Android Storage Access Framework (SAF) we can access any app that implements DocumentProvider.
We should use
There are some documented restrictions, but I think it does not affect normal user usage: |
Capacitor allows us to call an intent with result (e.g. |
I found 2 guides that describe how to use SAF to list and open files.
I managed to implement directory picker and directory listing. |
* Dropped external capacitor plugins - not stable / usable * Using custom Android plugin with Storage Access Framework * Able to pick directory and list directory contents
* Interactions do not work, need to see why
Is the native android client still being developed? It would be much easier to use. |
@danielkrajnik : I use a build I did for grocerie shopping, to check off things I bought. You can build it yourself or install the APK https://github.com/ieugen/organice/releases/tag/android-local-fs.v1 . |
Fantastic, thank you for pointing me to the build. I will give it a try. I understand that this is the only way for organice to access local files without involving external servers? Have you tried by any chance running a simple webdav server locally (for example dufs via termux) and access them from a locally served react app? |
Sorry, but how do you build this .apk? I couldn't find it mentioned anywhere and I'm not quite sure how it's usually done with react. |
@danielkrajnik : Follow the build instructions: https://github.com/ieugen/organice/tree/android-local-fs#native-app-on-android . |
@danielkrajnik : I did not try local webdav server. |
thank you very much, I've totally missed that. Node version as of June 2023 is 12.13.1. Really curious why it's so old (I'm not a web dev). Will try it out. Regarding the webdav I was thinking of running it locally on android (localhost from termux), so no internet connection would be needed. |
@danielkrajnik : Share your setup. |
local webdav server is the only thing that I've got working so far: using dufs you need to generate TLS certificates: However, I couldn't get organice serve on localhost due to this old nodejs version unavailable on native termux. It may work on proot, but haven't got to it yet. I'm reporting updates in this issue by the way. I suspect that easiest thing to do would be to bundle it up as static assets and use some lightweight http server, but I'm not sure how to do it (I think you need to |
@ieugen tried your local storage build. Seemed to work to an extent. Doesn't seem to save preferences (color schemes, default delay setting) or capture templates. Is this expected? I think organice is supposed to save these to the sync directory? |
Feel free to hack on it @ERamseth . |
I ended up using orgzly(-revived) as well. It works okay as long as you stick to specific notebooks (it still doesn't delete notebooks if they were deleted in an upstream location) |
@ieugen @danielkrajnik yeah I tried orgzly as well. In the end I went back to todo.txt org-mode to heavy for my needs I think. And I don't really like the way it handles recurring todo items. To each their own of course. |
@ERamseth funny for you to say that now as I'm just experiencing problems with scheduling recurring events in orgzly... |
@pjhfggij I didnt necessarily have problems scheduling. I just don't like how when you "check off" a recurring to-do... it doesn't really "check off" it just adds some sub-entry/metadata about the last time it was checked off. Functionally it's fine I guess, but visually, I prefer how todo.txt handles it. |
@ERamseth what do you mean by "check-off"? I tend to just remove the notification when a recurring task is due without modifying it in any way (at least if they worked).
Interesting, I've never heard of todo.txt before. Thanks. |
So, recurring tasks are sort of an extension to the core todo.txt syntaxes, but many editors support them. Basically when you "check off" a recurring task in todo.txt it gets crossed off your list and a new line is added with updated due date and the old line is still there, just checked off (or crossed off). Far as I could tell, on organice (and other org mode editors), if the recurrence works at all, it just adds some Metadata to the entry about when it was last done and updates the due date. Mostly a matter of preference, but I do think the way organice was handling it was not super great because i found myself "checking off" tasks multiple times, not realizing it registered the tap to check it off. |
Some visual confirmation on switching back to TODO would be nice. On desktop I have a tri-state |
This issue is to enable organice running as a native Android app to provide access to local files.
IOs should be added later, but is out of scope for this (I don't know IOs).
Workflow should be like this:
I believe native android with local storage is achievable.
There is prior work on organice
develop
branch.It uses capacitor-js to build a native Android version of organice.
organice runs in a web view and should be able to access native Android (and IOs) filesystem API's via capacitor plugins.
I tried to implement the code with some success using https://github.com/ionic-team/capacitor-plugins/tree/main/filesystem plugin and https://github.com/capawesome-team/capacitor-file-picker .
I managed to create and read files but not control exactly where to put them and also did not manage to use the right native open file dialog (use SD card or other providers) .
I talked with one friend who is familiar with Android dev and also did some checking and I published my findings as comments on
pickDirectory(...)
method capawesome-team/capacitor-plugins#16I think the easiest solution for us long term would be to implement our own capacitor plugin with and API specific to organice.
I believe the Android Java code will be easy to maintain and port to something else then capacitor if there is ever the need.
Also the API surface is small.
The downside of this approach is that the IOs interface should be developed separately (by someone who knows this part)
Related issues:
The text was updated successfully, but these errors were encountered: