Adicionando um ícone à MIDlet
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot update of Template:ArticleMetaData) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot update - Fix metadata) |
||
| (3 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | + | [[Category:Java ME]][[Category:Code Snippet]][[Category:Lang-Portuguese]][[Category:General Programming]][[Category:UI]][[Category:S60 3rd Edition FP1]] | |
| − | + | {{Abstract|Este trecho de código demosntra como adicionar um ícone a uma MIDlet.}} | |
| − | {{ArticleMetaData | + | {{ArticleMetaData <!-- v1.2 --> |
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | ||
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) --> | |installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) --> | ||
| − | |devices=Nokia N95 8GB | + | |devices= Nokia N95 8GB |
| − | |sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) --> | + | |sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) --> |
| − | |platform=S60 3rd Edition, FP1 | + | |platform= S60 3rd Edition, FP1 |
| − | |devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) --> | + | |devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) --> |
| − | |dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 --> | + | |dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 --> |
| − | |signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer --> | + | |signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer --> |
| − | |capabilities=<!-- Capabilities required (e.g. Location, NetworkServices. | + | |capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. --> |
| − | |keywords= | + | |keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase --> |
| − | + | |language= Lang-Portuguese | |
| − | |language=Lang-Portuguese | + | |translated-by= [[User:Ivocalado]] |
| − | |translated-by=[[User:Ivocalado]] | + | |translated-from-title= Adding an icon to a MIDlet |
| − | |translated-from-title= | + | |translated-from-id= 35597 <!-- automated guess --> |
| − | |translated-from-id=35597 <!-- automated guess --> | + | |review-by= <!-- After re-review: [[User:username]] --> |
| − | |review-by=<!-- After re-review: [[User:username]] --> | + | |
|review-timestamp= <!-- After re-review: YYYYMMDD --> | |review-timestamp= <!-- After re-review: YYYYMMDD --> | ||
|update-by= <!-- After significant update: [[User:username]]--> | |update-by= <!-- After significant update: [[User:username]]--> | ||
|update-timestamp= <!-- After significant update: YYYYMMDD --> | |update-timestamp= <!-- After significant update: YYYYMMDD --> | ||
| − | |creationdate=20090915 | + | |creationdate= 20090915 |
| − | |author=[[User:Tapla]] | + | |author= [[User:Tapla]] |
| − | + | <!-- The following are not in current metadata --> | |
| − | <!-- The following | + | |id= CS000958 |
| − | | | + | |
| − | + | ||
}} | }} | ||
| − | |||
| − | |||
| − | |||
| − | |||
==manifest.mf== | ==manifest.mf== | ||
| − | O arquivo ''manifest'' provê informações sobre a MIDlet. Para adicionar um ícone à MIDlet, adicione o atributo | + | O arquivo ''manifest'' provê informações sobre a MIDlet. Para adicionar um ícone à MIDlet, adicione o atributo {{Icode|MIDlet-<n>}} ao arquivo ''manifest'', onde {{Icode|n}} é um inteiro identificando a MIDlet: |
<code> | <code> | ||
| Line 68: | Line 61: | ||
</code> | </code> | ||
| − | '''Nota''': According to [[ | + | '''Nota''': According to [[Archived:MIDlet attributes on JAD and manifest files must match (Known Issue)]], os atributos que são comuns entre os arquivos ''manifest'' JAD devem ser idênticos. |
==Pós-condições== | ==Pós-condições== | ||
| Line 79: | Line 72: | ||
| − | [[Category: | + | <!-- Translation --> [[en:Adding an icon to a MIDlet]][[Category:Nokia Belle]] [[Category:Series 40 Developer Platform 2.0]] [[Category:MIDP 2.0]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 6th Edition (initial release)]] |
| − | + | ||
Latest revision as of 09:07, 14 September 2012
Este trecho de código demosntra como adicionar um ícone a uma MIDlet.
Dados do artigo
Testado com
Compatibilidade
Artigo
Contents |
manifest.mf
O arquivo manifest provê informações sobre a MIDlet. Para adicionar um ícone à MIDlet, adicione o atributo MIDlet-<n> ao arquivo manifest, onde n é um inteiro identificando a MIDlet:
MIDlet-1: midletName,icon,mainClass
Abaixo é apresentado um exemplo completo do arquivo manifest:
MIDlet-Name: MIDgetSuite
MIDlet-Vendor: Vendor, Inc.
MIDlet-Version: 0.1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0
MIDlet-1: MIDget,/icons/icon.png,MainEngine
Arquivo JAD
É possível também adicionar informações sobre a MIDlet no arquivo de descriação de aplicação Java (JAD). Arquivos JADs são úteis porque ao invés de efetuar o download completo de um – possivelmente grande –arquivo Jar, uma MIDlet pode primeiramente recuperar o arquivo JAD da aplicação para prover ao usuário informações da aplicação e baseado nisso o usuário pode decidir se o download da aplicação vale a pena. O arquivo JAD não é obrigatório, e não é diretamente relacionado aos ícones (a maioria dos dispositivos S60 ignoram a definição de ícones), mas aqui é apresentado um exemplo de uso:
MIDlet-Name: MIDgetSuite
MIDlet-Vendor: Vendor, Inc.
MIDlet-Version: 0.1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0
MIDlet-Jar-Size: 2245
MIDlet-Jar-URL: MIDgetSuite.jar
MIDlet-1: MIDget,/icons/icon.png,MainEngine
Nota: According to Archived:MIDlet attributes on JAD and manifest files must match (Known Issue), os atributos que são comuns entre os arquivos manifest JAD devem ser idênticos.
Pós-condições
Após a MIDlet ser empacotada dentro de um arquivo JAR e instalada no dispositivo, o ícone especificado é exibido.
Veja também
- Jad & manifest entries/attributes, para uma lista e descrição sobre os possíveis atributos dos arquivos manifest e JAD.

