现在的位置: 首页 > 综合 > 正文

Series 60 中Icons, .AIFs和.SIS文件的说明

2013年09月01日 ⁄ 综合 ⁄ 共 4225字 ⁄ 字号 评论关闭

Turning your program into a nicely packaged application with its own icon and name is not too difficult. However, Symbian and Nokia have succeeded in creating a fair amount of confusion by throwing far more tools into the SDK than is strictly required, with documentation that spans countless dozens of pages.

This document, then, exists for the normal Symbian programmer in the street who wishes to take a simple program with no dependencies and no special language requirements, and package it ready for the real world. However, the subject is lengthy and complex, so expect to refer to the official documentation at least a few times before being able to do this successfully.

1. Things You Will Need
Some icons in .bmp format, thus:

44x44 colour bitmap icon
44x44 one-bit mask
42x29 colour bitmap icon
42x29 one-bit mask
An application information file with an .aif extension. This is described in section 3.
A package file with a .pkg extension. This is described in section 4.

We will not be using AIF Builder or Sisar in this tutorial. It’s possible to survive without ever using them.

2. Preparing the Bitmaps
You will need to convert the four bitmaps into a single .mbm (multi bitmap) file using bmconv. Let us assume for the rest of this tutorial that our program is named Myapp. In the directory containing the bitmaps, type

bmconv Myapp.mbm icon-44x44-colour.bmp icon-44x44-mask.bmp icon-42x29-colour.bmp icon-42x29-mask.bmp

3. Preparing the .aif File
The .aif file is not a text file! It is generated from a special resource (.rss) file that you must write. Let us name it MyappAif.rss (there will most likely already be a file called Myapp.rss that contains the resources for the program’s internal workings). For most simple cases the following template should work:

// MyappAif.rss
#include <aiftool.rh>

RESOURCE AIF_DATA
{
caption_list=
    {
    CAPTION { code=ELangEnglish; caption="My App"; },
    CAPTION { code=ELangFrench; caption="Mon App";}
    };

// Replace the following app_uid with your program's UID.
app_uid=0x12345678;

// The number of icons (not including masks)
num_icons=2;
}

It is vitally important that the UID is the same as your application’s UID as listed in the project specification file. If it is not, the icons will not display. If you are uncertain about your UID or UIDs in general, consult the documentation accompanying the Series 60 SDK.

To create the .aif itself, run

aiftool MyappAif Myapp.mbm
from the directory containing your .rss file and the .mbm file from section 2. Note that the .rss extension is dropped from the first argument to aiftool - you will get a "The system cannot find the file specified" error if you forget to remove it [1].

4. Creating the .sis
The .sis file is the ’installer’ file that you’ll eventually be sending to your phone. Its construction is determined by a .pkg file, which looks something a little like this:

;Myapp.pkg

;Language - standard language definitions
&EN

#{"Myapp"},(0x12345678),1,0,5

;Supports Series 60 v 0.9
(0x101F6F88), 0, 0, 0, {"Series60ProductID"}

"/Symbian/6.1/Series60/epoc32/release/armi/urel/myapp.app"
  -"!:/system/apps/myapp/myapp.app"
"/Symbian/6.1/Series60/epoc32/release/armi/urel/myapp.rsc"
  -"!:/system/apps/myapp/myapp.rsc"
"/Symbian/6.1/Series60/epoc32/release/armi/urel/myapp.aif"
  -"!:/system/apps/myapp/myapp.aif"

Let’s briefly dissect this file, because you’ll need to make a few substitutions.

"Myapp" is the name of your application as you want it to appear. (0x12345678) is your application’s UID, as discussed in the previous section. The numbers following it are the version number (in this instance we have version 1.0, build 5).

A few lines later, (0x101F6F88) is the Product UID for the type of device your code is designed for. The example given here is for Series 60 version 0.9 and shall be used whenever it is possible. If you use product or platform specific APIs, you shall use the corresponding UID. Here is a list of Common products UIDs.

The lines following this are the files we want to copy, and the paths to copy them to. You will need to replace these with the path and filenames of your compiled code. If you have any other files such as bitmap (.mbm) or sound files, you’ll also need to add them. The !: let the user choose the target drive. You can specify C: or E: instead if you want the files to be installed on those drive.

Once this is all in place, do your final compile with

abld build armi urel
and make a .sis file using
makesis myapp.pkg
Then all that remains is to send it to your phone! Consult your device’s manual for more on this, because it does vary. Most bluetooth devices let you right-click the .sis file in Windows Explorer and use ’Send to -> Bluetooth -> (devicename)’, but your mileage may vary.

[1] Note that you can also automate the creation of the MBM and AIF files by adding the following line to the application MMP file:

AIF MyappAif.aif ../aif MyappAif.rss c8 icon-44x44-colour.bmp icon-44x44-mask.bmp icon-42x29-colour.bmp icon-42x29-mask.bmp

 

抱歉!评论已关闭.