NOTE: my question is indeed similar to the question above. However, there is a slight difference, which I explain below in my ADDENDUM section.
Original question ...
I am creating lots of text files on my Oreo-based Android device with various file extensions besides simply .txt
. For example, I have files with .xyz
extensions, .abc
extensions, and others, and I want all files with these particular suffixes to be seen as text files by my chosen text editor app. This way, whenever I select such a file, the system will choose that text editor to open them.
I have not found any way to do this, especially given that there is no default file association for text files that is offered in Android. But even if such a default text-file association were to exist, I don't know how to cause ad hoc filename suffixes to be associated with text files.
Furthermore, intents seem to operate on mime types, and I don't know how to associate these extra suffixes with text/plain
under Android.
Is there any way in Android (Oreo) for me to accomplish what I want?
Thank you in advance.
ADDENDUM: The post referenced above talks about how mime types are managed on an application-specific basis in Android, and that there is no official way to manage mime types on a system-wide basis.
I understand this, but I am asking something slightly different. Suppose an application is already configured in its manifest to respond to text-plain
items. My question is this: where in Android is the .txt
suffix defined as corresponding to text-plain
, and is there any way to add more suffixes (such as .abc
and .xyz
, as I describe above) on a system-wide basis to also be mapped to text-plain
?
I have a rooted device that makes use of Xposed
and Magisk
, and so even if there is no official way in Android to implement these kinds of mappings, I'm wondering if there might be any unofficial Xposed
or Magisk
modules that will enable this. I couldn't find any such Xposed
or Magisk
modules, but perhaps I'm overlooking something.
Also, since my device is rooted (and I also am able to change my selinux settings to permissive
), I could manually edit system configuration files anywhere on the device to add more filename suffixes to the text-plain
mapping, assuming that this mapping is indeed managed in some sort of system configuration file.
I also run Tasker
, and if such a mime configuration file exists, I could make sure that Tasker
always copies a special version of that file in place during boot-up. In addition, I run other utitilies which allow ad hoc scripts to be run at startup via init.d
.
Any thoughts? ...
plain/text
with these items even if they are opened outside of a file manager ... i.e., via an arbitrary app. Is that not possible?