gsantner / markor

Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
https://github.com/gsantner/markor/discussions/2269
Other
3.82k stars 366 forks source link

Filemanager & sync client support #197

Closed gsantner closed 3 years ago

gsantner commented 6 years ago

When visiting/commenting this issue - you should be coming from Markor's dialog saying that the file cannot be opened. Please tell below some details which system you have and which apps are involved. This issue will be updated with latest available information, please don't report combinations multiple times. You must have Markor v0.3.3 or greater installed to see the mentioned dialog.

Known working solutions (see dialog):

Not possible directly:

Impossible:

de-es commented 6 years ago

Android 7.1.2 / Lineage 14.1 Markor 0.3.6 Seafile Client 2.2.3 https://f-droid.org/packages/com.seafile.seadroid2/

Synced files are stored in /storage/emulated/0/Seafile/mailaddress@mymaildomain.com (myseafileserver.com)

You can only access/open the files within Seafile if they are already downloaded/synced.

gsantner commented 6 years ago

When you do click on a file inside your sync-client-filebrowser -> open with - does markor appear? If yes, are you willing to provide me some additional information then (will write it together).

de-es commented 6 years ago

Yes and yes. :+1:

gsantner commented 6 years ago

Install https://github.com/k3b/intent-intercept, do the open with and select intercept. click on top-copy clipboard, and paste me that here. you can uninstall after

de-es commented 6 years ago
intent://com.seafile.seadroid2.provider/name/storage/emulated/0/Seafile/mobile%40mymaildomain.com%20(myseafileserver.com)/Linux/tar.md#Intent;scheme=content;action=android.intent.action.EDIT;type=text/plain;launchFlags=0x3000000;end 
------------ 
ACTION: android.intent.action.EDIT 
DATA: content://com.seafile.seadroid2.provider/name/storage/emulated/0/Seafile/mobile%40mymaildomain.com%20(myseafileserver.com)/Linux/tar.md 
MIME: text/plain 
URI: intent://com.seafile.seadroid2.provider/name/storage/emulated/0/Seafile/mobile%40mymaildomain.com%20(myseafileserver.com)/Linux/tar.md#Intent;scheme=content;action=android.intent.action.EDIT;type=text/plain;launchFlags=0x3000000;end 
FLAGS: 
FLAG_ACTIVITY_FORWARD_RESULT 
FLAG_ACTIVITY_PREVIOUS_IS_TOP 

------------ 
AUFRUFBARE ACTIVITIES 
keine 
gsantner commented 6 years ago

looks very doable.

gsantner commented 6 years ago

@de-es is it always com.seafile.seadroid2.provider/name/storage/ or did you replace something by name? what can i expect there. Can you too write the full absolute path to the said file?

de-es commented 6 years ago

It is always the same word name, I didn't replace anything here. The full path on my internal storage would be Seafile/mobile@mymaildomain.com (myseafileserver.com)/Linux/tar.md. The space between email address and server name is intended.

gsantner commented 6 years ago

https://github.com/gsantner/markor/commit/ffce02f4b53816ebdcb2efbdb6ae76603d806963

de-es commented 6 years ago

Thank you. I will report back after the next release.

de-es commented 6 years ago

Works like a charm. Thank you very much, @gsantner !

indeedwatson commented 6 years ago

I followed the instructions regarding Dropbox, and I can edit dropbox files, but the files that I create in the dropbox folder via markor do not get read and uploaded by dropbox.

Is this a known limitation or am I doing something wrong?

gsantner commented 6 years ago

I don't have an Dropbox account, the app or like that, maybe other users can help you on Forum on how Dropbox app works. Markor does the editing stuff. but does not implement syncing, or control sync features of other apps (and won't do).

rainbyte commented 6 years ago

First, thanks for this great app!

I wanted to ask if Syncthing could be added to the list of supported clients. It works well to share the notes between my phone and my pc.

gsantner commented 6 years ago

Oh, I forgot the most obvious one - the one i use too :D. Markor is pretty much the best in combination with syncthing

rainbyte commented 6 years ago

Yeah, that's what I was looking for, I just wanted to save my notes in a folder (like a normal person) and share them easily, without making accounts on 3rd party sites or things like that.

jakejoh commented 6 years ago

what is meant by "Known working solutions (see dialog)"?

Is this how sync with Nextcloud is supposed to work?:

For some reason, Nextcloud (3.2.0) isn't detecting files created by Markor. Am I missing something there?

gsantner commented 6 years ago

You have to mark files as offline-available / always in sync. this has to be done on per file basis. new files never are synced, thats how their app works. look at their bugtracker, I think there are bugreports. Otherwise, you too can open files from nextcloud app.

gsantner commented 6 years ago

Closing this issue - it just serves as open for discussion but isn't a bug or something. Comments and Discussion is still welcome here - this topic is not locked.

duckbrain commented 6 years ago

I use tasker to generate a template file and open it in Markor. This stopped working a little while back. Tasker sends an intent like the following.

intent://net.dinglisch.android.taskerm.fileprovider/Others/Documents/church/church-2018-08-19.md#Intent;scheme=content;category=android.intent.category.DEFAULT;type=text/*;launchFlags=0x33000004;end 
------------ 
ACTION: android.intent.action.VIEW 
DATA: content://net.dinglisch.android.taskerm.fileprovider/Others/Documents/church/church-2018-08-19.md 
MIME: text/* 
URI: intent://net.dinglisch.android.taskerm.fileprovider/Others/Documents/church/church-2018-08-19.md#Intent;scheme=content;category=android.intent.category.DEFAULT;type=text/*;launchFlags=0x33000004;end 
CATEGORY: 
android.intent.category.DEFAULT 
FLAGS: 
FLAG_RECEIVER_REPLACE_PENDING 
FLAG_RECEIVER_FOREGROUND 
FLAG_ACTIVITY_FORWARD_RESULT 
FLAG_ACTIVITY_PREVIOUS_IS_TOP 
FLAG_FROM_BACKGROUND 

------------ 
MATCHING ACTIVITIES: 
Contacts (com.android.contacts - com.android.contacts.vcard.ImportVCardActivity) 
HTML Viewer (com.android.htmlviewer - com.android.htmlviewer.HTMLViewerActivity) 
Text Reader (com.amaze.filemanager - com.amaze.filemanager.activities.TextReader) 
Calendar (com.google.android.calendar - com.google.android.calendar.ICalLauncher) 
Markor (net.gsantner.markor - net.gsantner.markor.activity.DocumentActivity) 
Bromite (org.bromite.bromite - com.google.android.apps.chrome.IntentDispatcher) 
Decrypt (org.sufficientlysecure.keychain - org.sufficientlysecure.keychain.ui.DecryptActivity) 
Import Keys (org.sufficientlysecure.keychain - org.sufficientlysecure.keychain.ui.ImportKeysActivity) 

Using Intent Intercepter, i could modify it to a file:// URI, which worked. I tried crafting an intent myself, but it seems to modify like this it on the way out.

gsantner commented 6 years ago

whats the real path where "Others/Documents" starts?

duckbrain commented 6 years ago

/storage/emulated/0/Documents or /sdcard/Documents

gsantner commented 6 years ago

Do you self assign /Others/? And why like that, and not /sdcard/ e.g.?

dugite-code commented 6 years ago

@duckbrain in tasker I use the send intent action to get around this by building the full content URI:

A1: Variable Set [
    Name: %uri
    To: content://net.dinglisch.android.taskerm.fileprovider/storage/emulated/0/Markor/Food%20Diary/%date3/%date2/%date1.md
    Recurse Variables:  Off
    Do Maths: Off
    Append: Off ] 

A2: Send Intent [
    Action: android.intent.action.EDIT
    Cat:  Default
    Mime Type:  text/plain
    Data: %uri
    Extra:
    Extra:
    Extra:
    Package:
    Class:
    Target: Activity ] 

@gsantner I used to get the /Others/ directory as well now I see /external_files/ and I'm not sure what causes that to change

duckbrain commented 6 years ago

Thanks @dugite-code, that works!

I tried using the send intent, but with file://%filename instead of content://net.dinglisch.android.taskerm.fileprovider%filename, and Tasker would rewrite it to the Open file action's behavior.

m52go commented 5 years ago

Hi @gsantner, absolutely amazing app. I just ran into this issue. I'm trying to get Markdor to open a .md file with an absolute path through an app that's not a file explorer.

Basically I'm generating a new .md file in my app, and then want to immediately open it in Markdor to edit it.

Just FYI...not deal-breaking for me, but thought you should know. It looks like the focus here is on file managers.

clach04 commented 5 years ago

Problem report for Mgit version 1.5.5.1 from:

Intent debug information below:

intent://com.manichord.mgit.fileprovider/external/Android/data/com.manichord.mgit/files/repo/passogva/README.md#Intent;scheme=content;action=android.intent.action.EDIT;type=text/plain;launchFlags=0x3000003;end 
------------ 
ACTION: android.intent.action.EDIT 
DATA: content://com.manichord.mgit.fileprovider/external/Android/data/com.manichord.mgit/files/repo/passogva/README.md 
MIME: text/plain 
URI: intent://com.manichord.mgit.fileprovider/external/Android/data/com.manichord.mgit/files/repo/passogva/README.md#Intent;scheme=content;action=android.intent.action.EDIT;type=text/plain;launchFlags=0x3000003;end 
FLAGS: 
FLAG_ACTIVITY_FORWARD_RESULT 
FLAG_GRANT_READ_URI_PERMISSION 
FLAG_ACTIVITY_PREVIOUS_IS_TOP 
FLAG_GRANT_WRITE_URI_PERMISSION 

------------ 
MATCHING ACTIVITIES: 
Markor (net.gsantner.markor - net.gsantner.markor.activity.DocumentActivity) 
ES Note Editor (com.estrongs.android.pop - com.estrongs.android.pop.app.editor.PopNoteEditor) 
Diary (org.billthefarmer.diary - org.billthefarmer.diary.Editor)

@gsantner any other information I can gather?

edit to reformat (originally submitted from phone) and add more context/detail.

gsantner commented 5 years ago

@m52go:

Hi @gsantner, absolutely amazing app. I just ran into this issue. I'm trying to get Markdor to open a .md file with an absolute path through an app that's not a file explorer.

Add the real_file_path_2 string extra to intent for editor activity, set the absolute filepath there, thats all you need :wink: .

gsantner commented 5 years ago

@clach04 : Mgit (and potential some others) are support with next update @dugite-code / @duckbrain : You can also use the real_file_path_2 approach above

linsui commented 5 years ago
intent://com.android.externalstorage.documents/document/home%3Amarkor%2FQuickNote.md#Intent;scheme=content;type=application/octet-stream;launchFlags=0x3000000;end 
------------ 
ACTION: android.intent.action.VIEW 
DATA: content://com.android.externalstorage.documents/document/home%3Amarkor%2FQuickNote.md 
MIME: application/octet-stream 
URI: intent://com.android.externalstorage.documents/document/home%3Amarkor%2FQuickNote.md#Intent;scheme=content;type=application/octet-stream;launchFlags=0x3000000;end 
FLAGS: 
FLAG_ACTIVITY_FORWARD_RESULT 
FLAG_ACTIVITY_PREVIOUS_IS_TOP 

I open QuickNote.md in markor directory with stock file manager on Android 9 and failed. I can always open these file in Markor but not in file manager.

@gsantner The filepath is /storage/emulated/0/Documents/markor/QuickNote.md

gsantner commented 5 years ago

@linsui can you please edit/update comment and add real/absolute filepath where the said file is really stored?

sys9kdr commented 5 years ago

@indeedwatson https://github.com/gsantner/markor/issues/197#issuecomment-389385149

I followed the instructions regarding Dropbox, and I can edit dropbox files, but the files that I create in the dropbox folder via markor do not get read and uploaded by dropbox.

Is this a known limitation or am I doing something wrong?

With following the guide about dropbox, you can edit existing files only but can't create new files recognized by dropbox app. I think current guide about dropbox cause confusing.

I use AutoSync for Dropbox to sync markor/dropbox. It works fine.

gsantner commented 5 years ago

Dropbox: Also suggest to use AutoSync or FolderSync app.

As of new files, when using none of the apps above and only the official Dropbox apo: Yeah you need to create/upload the initial version yourself inside dropbox app.

clach04 commented 5 years ago

@gsantner Quick test https://github.com/gsantner/markor/releases/tag/v1.8.2 and Mgit successful :+1:

kpm commented 5 years ago

Doesn't open an existing file in dropbox for android, v148.2.2. I have made the file available offline.

proofy commented 5 years ago

Microsoft OneDrive Version 5.3.6.3 Markor Version 2.0.4 Android 7.0

intent://com.microsoft.skydrive.content.external/Drive/ID/1/Item/RID/https%3A%2F%2Fcompany-my.sharepoint.de%2Fpersonal%2Fs_name_domain_de%2F_api%213f7066ec-a1b2-4b6b-983e-c33127059c5c/Stream/1/Property/QuickNote.md#Intent;scheme=content;type=application/octet-stream;launchFlags=0x3000000;end 
------------ 
ACTION: android.intent.action.VIEW 
DATA: content://com.microsoft.skydrive.content.external/Drive/ID/1/Item/RID/https%3A%2F%2Fcompany-my.sharepoint.de%2Fpersonal%2Fs_name_domain_de%2F_api%213f7066ec-a1b2-4b6b-983e-c33127059c5c/Stream/1/Property/QuickNote.md 
MIME: application/octet-stream 
URI: intent://com.microsoft.skydrive.content.external/Drive/ID/1/Item/RID/https%3A%2F%2Fcompany-my.sharepoint.de%2Fpersonal%2Fs_name_domain_de%2F_api%213f7066ec-a1b2-4b6b-983e-c33127059c5c/Stream/1/Property/QuickNote.md#Intent;scheme=content;type=application/octet-stream;launchFlags=0x3000000;end 
FLAGS: 
FLAG_ACTIVITY_FORWARD_RESULT 
FLAG_ACTIVITY_PREVIOUS_IS_TOP 

------------ 
onActivityResult: 
resultCode: 0 
smnthermes commented 5 years ago

@gsantner it should at least be able to read the file

Android 9 (LineageOS) Telegram 5.11.0 Markor 2.1.6

alystair commented 4 years ago

OneDrive support not possible?

ibnishak commented 4 years ago

Android 10

Mixplorer Termux

gsantner commented 4 years ago

OneDrive support not possible?

As in Markor syncs itself? Nope. Other client? Yes, FolderSync.

PhilT commented 4 years ago

Android 10 Sync.com - todo.txt file is marked for sync offline Markor v2.2.10 (113)

Shout if you need any more info. Thanks.

sudomain commented 4 years ago

@ibnishak can you provide more details? From Markor are you able to open files contained in the Termux private storage (/data/data/com.termux/files/)? Currently I keep my files in shared storage and create symlinks to it in my Termux $HOME. Theoretically it should be possible for Markor to access files in $HOME using the contentprovider, but I haven't gotten it working. I say this because my KeePassDX app is able access my keepass.kdbx file in $HOME using

content://com.termux.documents/document//data/data/com.termux/files/home/keepass.kbdx

kkuhle commented 4 years ago

+1

Android 10

Mixplorer Termux

cauerego commented 4 years ago

android 11 will limit storage access even further, and termux will probably only be accessible through FTP or the private storage as mentioned by @sudomain

this is already an issue in my case, android 11 beta.

granted, it's a common issue among most apps. very few do offer this kind of storage access.

gsantner commented 4 years ago

Well, basically Android 11 kills the file access freedom at Android, thats the sad but real state.

Markor gonna be limited to its private storage only then.

cauerego commented 4 years ago

for instance, Material Files (Open source Material Design file manager) - https://f-droid.org/packages/me.zhanghai.android.files can access termux and any other private storage that is opened for such, along with the public storage, still useful for general files and some apps still have access to it.

Wikunia commented 4 years ago

DS File (Synology Disk Station App) Latest version of Android (10) on Pixel 3 and latest version of the App. Would love to be able to edit my synced markdown files this way.

jamescridland commented 4 years ago

I just clicked a Markdown file in Gmail, and got this message.

Pixel 3a, latest production Android 11.

Jaaaarne commented 4 years ago

I'm receiving this message when trying to open a Markdown file stored inside of a TrueCrypt container, which I open on Android with EDS Lite app. Device runs Android 10. The container is not mounted, strictly speaking. The app uses a temp directory, inside which it creates a couple of more directories, inside which the unencrypted file is placed. After closing the container, the app deletes them.

I tried pointing Markor to the permanent "base" temp directory to make it Markor's working directory. Still not working. At the same time, the built-in text editor in the file manager is able to open those files in the container and save changes to them. At the moment even manually navigating to said temp directory via any file manager does not allow to open file, although on the first try it did work. Once.

I understand it's not quite the sync issue, but still. Is there a workaround, except opening the decrypted file directly from the EDS temp directory?

whispy commented 3 years ago

Tried on Android 8.1.0, 9, 10 Dropbox Android App

Dropbox recently changed the method they use to store offline files. Previously, they stored offline files in Android/data/com.dropbox.android/. Since the change, they now store them in: /data/data/com.dropbox.android/files/user_data/files/u123456/scratch/.

Markor appears to be unable to navigate to this folder. When trying to Open As a .md file from this folder in Markor, I got the error that led me here.

Any suggestions?