Menu Sign In Contact FAQ
Banner
Welcome to our forums

Filetype to app association in Android

From the dial-up thread, is it really not possible? I have this from somebody

Administrator
Shoreham EGKA, United Kingdom

Hm … but then how you can open let’s say PFD attached to e-mail. I believe it uses exactly that mechanism – associate filetype to app and passes filename and its location as arguments. I’ll check with my developers how exactly it’s implemented and what can be done but I think it’s connected with programming and registering the app during installation – I’m not sure it this can be done afterwards.

LDZA LDVA, Croatia

An app registers on installation, what type of files it can open.

When you attempt to open such a file, Android asks you which app, of the ones registered as being able to open that file time, you want to use.

When you select one, it’s copied to that app’s “inbox” (a new copy of the file…the original one stays where it was). That app is then called, and it opens that file in its “inbox”.

I don’t think that there is any way for the user to associate a file with an app, at least it’s not designed that a user can do that.

The whole idea is that an app knows nothing outside it’s own folder. That makes it much harder for viruses and malware to interfere with other programs or data. It also means that when you uninstall an app, it doesn’t leave junk behind in other folders, and when you install a new app, it shouldn’t have any harmful effect on any other apps functions.

EIWT Weston, Ireland

I’ve never had anything Androidlike under my hands, but it is said to base upon Linux. In Linux, like in all Unix-related environments, file extensions have little meaning, they rather help the poor human identifying the file than the software working with it. The file type is often indicated in the first handful of bytes in the body of the file, example for a pdf file is below. There is a utility in most Unix variants that gives the type of file, I believe its first source of information is this internal header. If it cannot find anything it recognises, it will classify the file as “data” unless it looks like readable, then calling it “ASCII text”.

When mailing an attachment that the mailer has been taught to reject (.jpg or .ppt or .avi or whatever) it is a common trick to rename the file with a harmless extension; this will work less well in well-written Unix environment.

The mechanism has its limitations: my music data in the abc format is considered to be Fortran code – shivers! But it couldn’t be fooled by the extension: even after a rename to mechelse.cba the file is still considered Fortran code. Still stranger that some of the *abc files are recognised as “ASCII text” as they should all have been.

= example 1 : header of a pdf file ===

head -c 100 rubisjol.pdf | od -c
0000000 % P D F – 1 . 4 \n % 307 354 217 242 \n 5
0000020 0 o b j \n < < / L e n g t h
0000040 6 0 R / F i l t e r / F
0000060 l a t e D e c o d e > > \n s t r
0000100 e a m \n x 234 225 ] K 263 m 271 M 236 237 _
0000120 261 207 235 A o 374 220 _ 003 212 342 U P 314 240 {
0000140 006 \f 310 %
0000144

== example 2 : file type detected by the file utility

for F in * ; do file $F ; done
kruiskes.abc: ASCII text
kruiskes.pdf: PDF document, version 1.4
kruiskes.ps: PostScript document text conforming DSC level 2.0, Level 3
mechelse.cba: FORTRAN program,
mechelse.pdf: PDF document, version 1.4
mechelse.ps: PostScript document text conforming DSC level 2.0, Level 3
purcell.abc: FORTRAN program,
purcell.abc~: ASCII text
purcell.pdf: PDF document, version 1.4
purcell.ps: PostScript document text conforming DSC level 2.0, Level 3
rubisjol.abc: ASCII text
rubisjol.pdf: PDF document, version 1.4
rubisjol.ps: PostScript document text conforming DSC level 2.0, Level 3

EBZH Kiewit, Belgium

The problem is fairly specific to Oziexplorer.

If I click on say a mp4 or m4v file, the tablet offers the three apps I have which can play it. I choose VLC Media Player and click on Always. That is how most of the stuff works on this tablet.

But if I click on a .map file (the Oziexplorer goreferencing file), in Root Explorer as usual, all that happens is that RE offers a list of files which don’t include Ozi:

text viewer
sqlite database viewer
linux script hanlder
apk handler
text editor
zip viewer
tar viewer
rar viewer

So it looks like Ozi failed to register itself correctly upon installation.

Administrator
Shoreham EGKA, United Kingdom

In Linux, like in all Unix-related environments, file extensions have little meaning, they rather help the poor human identifying the file than the software working with it.

They certainly have meaning! Programs working with particular file types default to particular file extensions. In a Unix system with desktop-style graphic user interface, they are used to select the application to open the program, just as in Windows.

There is a utility in most Unix variants that gives the type of file, I believe its first source of information is this internal header.

It doesn’t give the type of the file. It guesses the type of the file. Quite different.

ESKC (Uppsala/Sundbro), Sweden
6 Posts
Sign in to add your message

Back to Top