Tuesday, December 11, 2012

Android Explained: File Associations

File ... what?


File associations are a relic of modern computing, where most data is stored in the form of files. Each file has a name and resides in a directory. Because there were no universal formats for storing data, or even for determining the type of data contained within the file, operating systems began encoding the type of data into the file name itself, by adding a "." and then a code describing the type of data contained in the file. Most seasoned users would recognize the now common ones like .TXT (text file) or .EXE (application).

Now, with a semi-universal scheme of file extensions, it because much easier to know what computer program(s) a file belonged to. Just so long as the format of the data in the file matches the semi-universally-accepted file extension, everything works without a hitch. In practice it's not as bad as it sounds.

So, a file association is just a list of a program or programs (if you're under 30, call them "apps" instead) which are believed to be able to read a file of that format. It's no guarantee, but most of the time it works.

Here Comes Android


Android File Association Prompt
File associations shown if there's no default selected
For decades, Windows has handled this smoothly and effectively. But Windows had a long, long time to get it right. Android is still fairly new, and it doesn't seem like they thought this through all the way.

In Android, an app registers its intent to work with a certain kind of data. So for example, a video player might register for one or more video formats, like MP4, AVI, etc. When you open a file in Android, the system looks through a list of apps which can work with that data, just like the system does in Windows.

Changing File Association Defaults in Android


The difference then is that where the default application for a file format is stored with the system itself in Windows, in Android its assigned to the app which is the default for that data type. So, when you open an AVI file, Android looks through all the apps registered for that data format (actually MIME type in nerdspeak) and looks at each one to see if it is the default app. This seems a little clumsy to me, but at least it's done seamlessly to the user.

BUT .. what if YOU the user want to change this default association? The answer is that you have to see what app launches, go into settings and then choose "apps" or "app management" on the settings menu, find that app, and manually clear that default association. At that point the system will start asking you from a list of candidates, until you choose another default.

Android File Association For App
In Android, the default file association belongs to an app, and you have to find that app to clear it!




3 comments:

  1. And if you deleted the app that was associated, looks like you have no way back - it incorrectly associated .docm files with a zip application I had installed and I assumed deleting the app would remove the association but it doesn't - after searching further, i realised the file assoc is an attribute of the application and not the extensio but now it just gets an error and I can't find a way to remove the old association - will try reinstalling the app I deleted but its a pita !

    ReplyDelete
  2. And how about associating of a type which does not have its defautl application installed? For example, someone sends me a program source by email or which I have on my SD card. The "extension" is .c, .pas, .tx, .whatever... which I know is a plain text file. Or its mime type is whatever previously unknown (or wrongly set by the sender mailer). It could be viewed with many apps, but none of them thought I might want to use it so.
    Can I somehow "force" the application to open a file type which its author didn't know about?

    ReplyDelete
    Replies
    1. Not that I'm aware of. Windows thought of all this but I think it's just that Android still isn't quite a mature operating system yet. But Google is a smart company, so give it time.

      Delete