Adicionando um ícone à MIDlet
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot update - Fix ArticleMetaData) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot update - Fix metadata) |
||
| (One intermediate revision 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 <!-- v1.2 --> | {{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]]) --> | ||
| Line 14: | Line 14: | ||
|language= Lang-Portuguese | |language= Lang-Portuguese | ||
|translated-by= [[User:Ivocalado]] | |translated-by= [[User:Ivocalado]] | ||
| − | |translated-from-title= | + | |translated-from-title= Adding an icon to a MIDlet |
|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]] --> | ||
| Line 23: | Line 23: | ||
|author= [[User:Tapla]] | |author= [[User:Tapla]] | ||
<!-- The following are not in current metadata --> | <!-- The following are not in current metadata --> | ||
| − | |||
|id= CS000958 | |id= CS000958 | ||
}} | }} | ||
| − | |||
| − | |||
| − | |||
| − | |||
==manifest.mf== | ==manifest.mf== | ||
| Line 77: | 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.

