billthefarmer / editor

Android simple text editor
https://billthefarmer.github.io/editor
GNU General Public License v3.0
474 stars 85 forks source link

Can't open .js file from termux storage #222

Closed ghost closed 7 months ago

ghost commented 7 months ago

Screenshot_20240130-153515_Files

billthefarmer commented 7 months ago

If you use the storage button in the file open dialog, the request uses the mime type text/*, which is a request for any type of text file. Unfortunately, android file managers either use application/octet-stream, application/javascript, or nothing at all in the case of a Samsung file manager, rather than text/javascript, which would be more helpful. You can find out which by using the Intent Intercept app from F-Droid. If it is possible to share a file from Termux, that might be more useful. See #188.

ghost commented 7 months ago

then xould you add more types?

ghost commented 7 months ago

if i'm nit mistaken it's here, right?: https://github.com/billthefarmer/editor/blob/master/src/main/java/org/billthefarmer/editor/OpenFile.java#L271

ghost commented 7 months ago

i can open it with termux-open, but then i can't save it

billthefarmer commented 7 months ago

That's correct, however you can only set one mime type. You can have as many mime types as you like when indicating what sorts of files you can open.

ghost commented 7 months ago

did you mean you can't?

ghost commented 7 months ago

can you set it to '*' instead then?

billthefarmer commented 7 months ago

You probably won't be able to save a file from Termux because it will probably be in the app's private storage. If you had read the thread I linked to, read the README, or looked at the closed issues you will see why I'm not changing the mime type.