Symbian
Symbian OS Library

FAQ-1041 Beware of hardcoding filenames which may not be present on all phones!

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



 

Classification: General Category: Development
Created: 04/28/2004 Modified: 05/05/2004
Number: FAQ-1041
Platform: Not Applicable

Question:
It is often a quick solution during development to hardcode the location of a system file which your application uses. However, beware of doing this in shipping products - can you really guarantee the file will be on all the phones you want to target?

Answer:
Think twice before hardcoding locations of system files into your application. Always bear in mind that Symbian OS offers licensees a huge degree of flexibility, allowing them to differentiate their phones. A system file which may be present on all phones from one manufacturer may not be present on all other phones using the same platform.

For example, all current Nokia Series 60 phones at the time of writing ship with the file \System\Sounds\Digital\Camera1a_2_8kHz.wav included. However, other Series 60 phones from different licensees may not include this file. An application which expects this file to be present (and at the very least does not correctly handle the error-condition if the file is not found) will not run correctly on such phones - and may produce hard-to-debug crashes for your users.