vhqtvn / VHEditor-Android

Run Code-server on Android
Other
978 stars 106 forks source link

Add VHEditor to "Open with" dialogue #47

Open alexanderadam opened 3 years ago

alexanderadam commented 3 years ago

I wanted to open a Ruby file but VHEditor isn't in the list of applications (I also tried to open a directory but this didn't work neither):

termux-open projects/website/config.rb   Open with "Krita" "Termux"

So you probably would have to add text files and source code files as association to the AndroidManifest.xml.

Since in this case I wanted to open a Ruby file, this would need at least the MIME type text/x-ruby but I guess adding something like <data android:mimeType="text/*" /> would solve this generically for all text file.

If VHEditor should be suggested for any file type, you could probably also simply use <data android:mimeType="*/*" /> in the manifest and then you could even still match for file extensions with something like <data android:pathPattern=".*\\.rb" /> (I don't think that matching a file extension would be necessary though).

And for opening directories, you probably would have to use the DocumentsContract.Document.MIME_TYPE_DIR (vnd.android.document/directory and for compatibility reasons maybe also inode/directory).

PS: Thank you so much for VHEditor. So far it looks great! PPS: I'm not an Android developer so I don't know whether any of what I wrote makes any sense 😉

vhqtvn commented 3 years ago

Thank you for your suggestion!

I'll try to work on this soon.