quick_recipes (779892), страница 61
Текст из файла (страница 61)
However, this is somewhat dependent on the security policy applied to the smartphone by the devicemanufacturer. There is no guarantee that manufacturers or network operators will always allow applications to install on their devices or useAPIs protected by user capabilities if they are not certified by SymbianSigned.If you need, or choose, to get your application Symbian Signed,there are several options available. The costs of the different optionsvary depending on whether a Publisher ID is required, and whetherindependent testing is required. More information is available on theSymbian Signed portal at www.symbiansigned.com.Publisher IDsPublisher ID digital certificates form part of the public key infrastructure,and are issued by Certificate Authorities (CAs).
The CA for SymbianSigned is TC TrustCenter.WHAT TO DO BEFORE YOU RELEASE YOUR APPLICATION337You can purchase Publisher IDs directly from TC TrustCenter atwww.trustcenter.de/order/publisherid/dev. The cost of acquiring a Publisher ID is relatively low, and there are several benefits associated withholding one, which include the following:• More flexible developer certificates can be requested, enabling muchwider deployment during development, for example, when performingbeta testing.• Owning a Publisher ID opens more signing options and gives youcontrol over publisher identity and branding.• Trust is important to end users of your application.
Owning a PublisherID allows you to enhance your reputation for delivering trustedapplications.Symbian Signed TestingAs we’ve already discussed, testing is an essential part of all softwaredevelopment, and Symbian Signed defines specific tests to ensure aminimum level of robustness and stability for applications running onSymbian smartphones.The Symbian Signed tests are defined in the Symbian Signed TestCriteria, and are divided into two main groups.Universal tests (prefixed UNI) focus on installation, uninstallation,reliability, robustness and normal operational behavior in accordancewith mobile phone end user expectations. For example:• Applications must install, uninstall and reinstall correctly, leaving noinstallation files behind after uninstall, and must install correctly fromexternal mass memory storage (for example, memory cards).• Applications must back up and restore successfully, and use appropriate file creation locations.• Applications must survive stress tests including low memory at startup, handling exceptional events like out-of-memory and power downor rebooting while running, and must handle service interruptions, aswell as rapid and repeated switching.• Applications must handle system events correctly and comply withTask List behavior guidelines.Capability-related tests (prefixed CAP) are additional tests that needto be passed by applications using certain specific capabilities only.
Forexample:• Applications with MultimediaDD capability must not interfere withvoice calls.338RELEASING YOUR APPLICATION• Phone applications must present a UI to enable the user to control theapplication.• VoIP applications must present a Device Manufacturer disclaimer, andmust not interfere with GSM-based telephony functions, including theability to make emergency calls.All applications are expected to comply with the universal tests, andapplications that use certain capabilities are required to comply with thecapability-related testsThe Symbian Signed test criteria document is constantly assessed andupdated, and the latest version is available from www.symbiansigned.com, where you can also find additional information about SymbianSigned.
In addition, there is a comprehensive manual about SymbianSigned at developer.symbian.com/main/signed.Freeware and Open SourceFreeware and open source applications can be submitted for SymbianSigning free of charge, without the need for a Publisher ID. For more information, visit the ‘Open Signed’ page at www.symbiansigned.com/app/page.6.1.6 Internationalize It!If you intend your application to run in more than one language, you willneed to consider how you will ‘internationalize’ it (sometimes this taskis also known as ‘localization’).
Internationalization generates softwarevariants in multiple languages from a single set of source files. Typically,you should aim to have a core of code which contains all the functionalityof your application and doesn’t change regardless of the language it ispresented in. A second part contains the changing content, such as textstrings displayed in the UI.Not only do you need to consider the differences in language whenyou internationalize, but you must also consider variations in writingsystems, regional differences (such as layout of numbers, time or measurements) and specific customizations. Although this may seem undulycomplex, by making your application accessible in different regions, youcan reap additional benefits in the form of wider market appeal andthe ability to enter markets that would otherwise have been unavailable to you.
Symbian OS was designed as an international OS fromthe ground up, and this makes it relatively easy to design applications for multiple languages and regions. That said, internationalizationneeds to be designed into your product from the start. Rewriting codeat late stages of development introduces complexity and the risk ofregression.WHAT TO DO BEFORE YOU RELEASE YOUR APPLICATION339For example, when creating an application, it is easy to place all thetext displayed in the UI directly, such as dialog titles or menu options,within the application’s RSS resource file.
While this works perfectlyfor a single-language application, when you come to create additional,different language versions, it makes it harder because you have to searchthe files to locate and translate each of the text elements. Symbianrecommends splitting the text out into a separate file, known as an RLSfile. RLS files contain token-value pairs which can then be used in theRSS file.For example, for an S60 MENU_PANE resource, specified in the RSSfile:// example.rss#include "example.rls"...// Define the menu items that comprise a menu paneRESOURCE MENU_PANE r_filebrowse_menu{items={MENU_ITEM { command=ECmdFileBrowseOpen;txt = STRING_r_filebrowse_loc_Open; },MENU_ITEM { command=EAknCmdExit;txt = STRING_r_filebrowse_loc_Exit; }};}In the associated RLS file, for the English version:// example.rlsrls_string STRING_r_filebrowse_loc_Openrls_string STRING_r_filebrowse_loc_Exit"Open""Exit"The RLS file can then be sent to translators to create a separate version,for example, in French or Japanese.
A translator will not necessarilybe a programmer and, for this reason, the structure of the RLS file isrestricted to straightforward token-value pairs. However, you can alsoinclude C- or C++-style comments in the text localization file to informthe translator of the context in which each text item appears, and to giveinformation about any constraints, such as the maximum length permittedfor a string.To build an application in multiple languages, the LANG specifier isused in an application’s MMP file. The keyword must be followed by alist of two-character codes, one for each language, for example:LANG 01 02The codes can be anything you like, but are normally taken from thetwo-digit values specified in the TLanguage enum in e32const.h.340RELEASING YOUR APPLICATIONThe Symbian OS build tools use the LANG statement to build theapplication’s resource files once for each code in the list.
For each build:• A LANGUAGE_XX symbol is defined.• The resulting binary is given a .rXX extension where XX representsthe language code for that build.These codes are listed in the Software Installation Toolkit, included inthe Symbian Developer Library, which can be found in the documentationset of your S60 3rd Edition or UIQ 3 SDK.You should include the appropriate RLS files in each of the application’slocalizable resource scripts, for example:// example.rss#ifdef LANGUAGE_01#include "exampleenglish.rls"#elif defined LANGUAGE_02#include "examplefrench.rls"#endif...// Define the menu items that comprise a menu paneRESOURCE MENU_PANE r_filebrowse_menu{items={MENU_ITEM { command=ECmdFileBrowseOpen;txt = STRING_r_filebrowse_loc_Open; },MENU_ITEM { command=EAknCmdExit;txt = STRING_r_filebrowse_loc_Exit; }};}In this case, the result of the build is to generate two resourcefiles, named example_loc.r01 and example_loc.r02, containingEnglish and French text, respectively.
These replace the example.rscfile, which is created if no LANG keyword is used in the MMP file, andneed to be included in the PKG package file, for installation to the phone.The PKG package file, used to build the software installation package,can be used to specify the language options available for the application.At install-time, only those language files specific to the language selectedby the user will be installed.