Symbian
Symbian OS Library

FAQ-0864 How do I associate my application with its owned files : Recognizers and AIF files

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Application Architecture
Created: 04/01/2003 Modified: 04/11/2003
Number: FAQ-0864
Platform: Not Applicable

Question:
- On file-based UIs, if I click on my file type (in the shell), I want my application to be launched to handle it.
- On a file-less UI (UIQ) I want to be able to filter for only the files that belong to my application.
- I want my application and its owned files to have the same icon.


Answer:
1. Standard Symbian OS files (e.g. Word files) contain the UIDs of their associated application. In this case, the application architecture automatically associates files with the application having the same UID.

    2. Non standard file types, e.g. HTML pages, eBookmarks etc do not contain Symbian OS UIDs, and must therefore be explicitly associated with an application.
    This is a two phase process. First you use a "recognizer" to identify the "MIME type" (e.g. "text/html") of your files. Then you specify that your application as capable of handling that file MIME-type. Both parts of this process are well documented in the Developer Library.

    ** To associate the application with a file type:
    You need to specify the supported MIME types in the application information file (aif file) capabilities section. See the MIME capabilities in the developer library at: " » Developer Library » Tools and Utilities » Application information file (AIF) builder guide » Using AIF Builder » How to use the Capabilities tab"

    ** To recognise the file as a particular type:
    You need to write a recogniser. See " » Developer Library » API Reference » C++ API reference » Recognizers » CApaDataRecognizerType"

    Problem solving
      1. Setting the application capabilities to support a MIME type is trivial. The only likely problem here is that you have a typographic error in your definition of the supported MIME type(s).
      2. It is more likely that your recogniser does not work. There are several possibilities
      • Some other recogniser idenfities the file as something else. In this case you need to increase the iConfidence value of your recogniser.
      • Your recogniser is returning that it identifies the file, but is returning an empty string. In all likelyhood you have set your iDataType member in the constructor, rather than in your implementation of CApaDataRecognizerType::doRecognizeL(). Since the iDataType member is Reset() prior to recognising the file, you will pass back a null string for the file type.
        Obviously nothing works then, because the system thinks your file is of type ""!