notes-android
notes-android copied to clipboard
📎 Attachments
It would be great in the view mode of the notes editor if referenced image files (jpg or animated gifs from ../media/...... ) were displayed.
Depends on https://github.com/nextcloud/notes/issues/74
What about encoding the image to base64? then we don't need backend support.
@aryasenna this already works in the latest Notes Android app. Though this is not a really solution as the note will be hard to edit (there are tons of characters) and incredibly slow to synchronize.
Sample note:

Yes I agree this is not final nor a good solution, but seeing the server app won't implement this anytime soon..
this already works in the latest Notes Android app.
Do you mean we already can take photo from camera/file system then insert it as base64?
(there are tons of characters)
Would wrapping mechanism for the image element be possible..? Also for readable notes it makes sense to resize the image anyway.
I'd try pull request, but my java and Android coding (now they use Kotlin?) is very rusty to say the least.😅
Do you mean we already can take photo from camera/file system then insert it as base64?
This was a sample of an image with only 20kB
or so. Now imagine the size of a photo with 5MB
. Even compressed and cropped this will be multiple times the character soup od the sample.
Sorry, but this workaround leads into the wrong direction. If we do it, we will do it the right way - everything else will raise expections by the users which we can't fulfill.
Would wrapping mechanism for the image element be possible..? Also for readable notes it makes sense to resize the image anyway.
Unfortunately there is no easy way for the editor to hide such stuff (while it is easy in preview mode).
I'd try pull request, but my java and Android coding (now they use Kotlin?) is very rusty to say the least
Yeah, well, i'd say it's not your fault but Android is a shithole. 😄 Given we don't have file handling implemented yet, and the permission stuff and file authority stuff isn't that easy (if you are not familiar with Android), it won't be easy anyway.
I'd suggest to make a PR to the server app to support the feature the proper way instead. It will probably be more straight forward with less bleeding edges.
Actually i think it should be simpler - just put image same folder to server and reference from the Note.
I found out that you can add an image (within nc) in this way

Is this an "official" way?
Btw, you have to find out the uuid of your image.
@SIRSteiner this is an "official" way for the Notes Android app. This is currently only available on F-Droid. It also works for valid paths on your files in your Nextcloud like /foo/bar%20baz.png
(where "valid" means that you will have to URL encode <kbdSpaces yourself)
This ain't exactly this issue though because it doesn't allow the upload of attachments and it does only work for images, not for other file types.
@stefan-niedermann As i experiment in https://github.com/nextcloud/notes/pull/785, where would i need to add link-normalization for markwon? it seems that module is in nextcloud-commons, but i don't think it is reasonable to implement a nextcloud-notes api in a reusable module
Good question, i have already thought about it. The remaining issue with your implementation in the context of the Notes Android app is to determine the root for relative paths (currently we only support absolute paths starting at the root or a fully qualified URL.
I guess we need to find a way to configure the GlideModule
at runtime for that. I recommend you to focus on the Notes server implementation, we can find a solution for this problem later or parallel.
Actually, you dont need to do that. (Or i misunderstood the problem)
There wont be a "path" for an image, just an api. So the image can always be accessed by: /notes/image/{id}/{path}
and the server does the path-resolution for you. It can calculate where the note is, and where the image should be in relation to that.
So, if you can prepend the full url to the relative path (and change ../ to ;;/) you always get the image. Does that solve your issue?
UrlProcessorRelativeToAbsolute It was renamed to ImageDestinationProcessorRelativeToAbsolute
Maybe we can expose this to the apps using markdown. However, as far as i understood it, this would remove ../, which is not working for our case.
We should think about how we can provide custom Link and URL Resolvers to nextcloud apps using your common-implementation, because i could imagine other apps also have the need to resolve relative links in markdown.
Using some sort of interface where we can pass custom Resolvers would allow for apps to extend existing resolvers and pass them to the renderer
@stefan-niedermann Do you have a good guide on how i would set up a development environment which also has the library in source-format? I'd like to try to tinker with the android app.
Unfortunately not, sorry, but i only code for the Notes Android client...
Do you develop nextcloud-commons and the notes app independently?
Otherwise i am going to build the nextclouc-commons library manually and use a local jar in the nextcloud-notes app
They are developed independently (commons is also used by Deck and maybe a few other apps)
so, to run a modified version of nc-commons i have to make changes, build the library, copy the jar and rebuild the notes app with that jar?
Hm, seems tedious, but thanks anyway!
I think one can link the gradle dependency to another local project, but i unfortunately haven't set up such an environment successfully yet 😕
@stefan-niedermann https://github.com/nextcloud/notes/pull/785 has been merged, to we can now start working on client side support.
@newhinton are you interested in joining forces here? Maybe we could have a short chat regarding the this? If yes, please contact me via [email protected] :slightly_smiling_face: :rocket:
Hi, i would like to add my experience:
(A) I understand that there is an app in F Droid store which I installed on Android 12 (B) I also have installed a Home URL Shortcut from my Brave browser on Android to the Nextcloud Notes server URL. (same Android 12 phone)
I try to find a way to make JPG attachments visible in both. (1)
I try to find a way to create a new note including uploading an attachment. (2)
(1) does only work with (B) in Desktop View, but then I cannot use the Shortcut URL on my Home Page
(2) leads in both cases (A) and (B) to the error
OCA\Notes\Service\ImageNotWritableException
is that expected until 25.0.6 and latest Notes App on Nextcloud or could it work better?
Any experience is helpful
Thank you so much.