Adicionando um ícone à MIDlet
hamishwillee
(Talk | contribs) m (Hamishwillee - Automated change of category from Lang-PT to Unlikely Category) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot update of Template:ArticleMetaData) |
||
| Line 1: | Line 1: | ||
| − | |||
{{ArticleMetaData | {{ArticleMetaData | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|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 | ||
|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 | ||
|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 --> | ||
|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 (e.g. Location, NetworkServices.) --> | ||
| − | | | + | |keywords= |
| + | |id=CS000958 | ||
| + | |language=Lang-Portuguese | ||
| + | |translated-by=[[User:Ivocalado]] | ||
| + | |translated-from-title=CS000958 - Adding an icon to a MIDlet | ||
| + | |translated-from-id=35597 <!-- automated guess --> | ||
| + | |review-by=<!-- After re-review: [[User:username]] --> | ||
| + | |review-timestamp= <!-- After re-review: YYYYMMDD --> | ||
| + | |update-by= <!-- After significant update: [[User:username]]--> | ||
| + | |update-timestamp= <!-- After significant update: YYYYMMDD --> | ||
| + | |creationdate=20090915 | ||
| + | |author=[[User:Tapla]] | ||
| + | |||
| + | <!-- The following items are not in the standard metadata template --> | ||
| + | |category=Java ME | ||
| + | |subcategory=Arquivos/Dados | ||
}} | }} | ||
| Line 71: | Line 80: | ||
[[Category:Java ME]][[Category:Code Examples]][[Category:Lang-Portuguese]] | [[Category:Java ME]][[Category:Code Examples]][[Category:Lang-Portuguese]] | ||
| + | <!-- Translation --> [[en:CS000958 - Adding an icon to a MIDlet]] | ||
Revision as of 01:58, 19 December 2011
Dados do artigo
Testado com
Compatibilidade
Artigo
Contents |
Introdução
Este trecho de código demosntra como adicionar um ícone a uma MIDlet.
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 KIJ000524 - MIDlet attributes on JAD and manifest files have to match, 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.

